MediaElement.Stretch Propriedade

Definição

Recebe ou define um Stretch valor que descreve como a MediaElement preenche o retâ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 Propriedade

O valor de stretch para o suporte renderizado. A predefinição é Uniform.

Exemplos

O exemplo seguinte mostra como criar um Viewbox e definir o Stretch modo de conteúdo.


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

Observações

A ilustração seguinte demonstra os diferentes Stretch valores.

Diferentes definições de alongamento TileBrush Diferentes métodos de dispersão do gradiente

Informação de Propriedade de Dependência

Iteme Value
Campo identificador StretchProperty
Propriedades dos metadados definidas como true AffectsMeasure

Aplica-se a