MediaElement.Stretch Proprietà

Definizione

Ottiene o imposta un valore Stretch che descrive come MediaElement riempie il rettangolo di destinazione.

public:
 property System::Windows::Media::Stretch Stretch { System::Windows::Media::Stretch get(); void set(System::Windows::Media::Stretch value); };
public System.Windows.Media.Stretch Stretch { get; set; }
member this.Stretch : System.Windows.Media.Stretch with get, set
Public Property Stretch As Stretch

Valore della proprietà

Il valore di adattamento per i supporti di cui è stato eseguito il rendering. Il valore predefinito è Uniform.

Esempio

Nell'esempio seguente viene illustrato come creare un oggetto Viewbox e impostare la Stretch modalità di contenuto.


// Create a Viewbox and add it to the Canvas
myViewbox = gcnew Viewbox();
myViewbox->StretchDirection = StretchDirection::Both;
myViewbox->Stretch = Stretch::Fill;
myViewbox->MaxWidth = 400;
myViewbox->MaxHeight = 400;

// Create a Viewbox and add it to the Canvas
myViewbox = new Viewbox();
myViewbox.StretchDirection = StretchDirection.Both;
myViewbox.Stretch = Stretch.Fill;
myViewbox.MaxWidth = 400;
myViewbox.MaxHeight = 400;

' Create a ViewBox and add it to the Canvas
Dim myViewbox As New Viewbox()
myViewbox.StretchDirection = StretchDirection.Both
myViewbox.Stretch = Stretch.Fill
myViewbox.MaxWidth = 400
myViewbox.MaxHeight = 400

Commenti

La figura seguente illustra i diversi Stretch valori.

Impostazioni diverse di TileBrush Stretch Diverse impostazioni
Diversi metodi di diffusione sfumatura

Informazioni proprietà di dipendenza

Campo Identificatore StretchProperty
Proprietà dei metadati impostate su true AffectsMeasure

Si applica a