MediaElement.Stretch Propiedad

Definición

Obtiene o establece un valor Stretch que describe cómo MediaElement rellena el rectángulo de destino.

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

Valor de propiedad

El valor de ajuste para los multimedia representados. De manera predeterminada, es Uniform.

Ejemplos

En el ejemplo siguiente se muestra cómo crear y Viewbox establecer el Stretch modo de contenido.


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

Comentarios

En la ilustración siguiente se muestran los distintos Stretch valores.

Diferentes valores de TileBrush Stretch diferentes
Diferentes métodos de propagación de degradado

Información sobre propiedades de dependencia

Campo identificador StretchProperty
Propiedades de metadatos establecidas en true AffectsMeasure

Se aplica a