MediaElement.Stretch Propiedad

Definición

Obtiene o establece un Stretch valor 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

Valor extendido del medio representado. El valor predeterminado 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.

Configuración diferente de TileBrush Stretch Diferentes métodos de propagación de degradado

Información de la propiedad dependency

Elemento Value
Campo identificador StretchProperty
Propiedades de metadatos establecidas en true AffectsMeasure

Se aplica a