MediaElement.Stretch Właściwość

Definicja

Pobiera lub ustawia Stretch wartość, która opisuje sposób MediaElement wypełniania prostokąta docelowego.

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

Wartość właściwości

Wartość rozciągnięcia renderowanego nośnika. Wartość domyślna to Uniform.

Przykłady

W poniższym przykładzie pokazano, jak utworzyć element Viewbox i ustawić Stretch tryb zawartości.


// 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

Uwagi

Na poniższej ilustracji przedstawiono różne Stretch wartości.

Różne ustawienia tileBrush Stretch Różne
Różne metody rozpraszania gradientu

Informacje dotyczące właściwości zależności

Pole identyfikatora StretchProperty
Właściwości metadanych ustawione na true AffectsMeasure

Dotyczy