MediaElement.Stretch プロパティ

定義

Stretchが目的の四角形をどのように塗りつぶすかを示すMediaElement値を取得または設定します。

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

プロパティ値

レンダリングされたメディアのストレッチ値。 既定値は Uniform です。

次の例は、 Viewbox を作成し、コンテンツの Stretch モードを設定する方法を示しています。


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

注釈

次の図は、さまざまな Stretch 値を示しています。

TileBrush Stretch の設定 さまざまなグラデーションの広がり方法

依存関係プロパティ情報

品目 価値
識別子フィールド StretchProperty
に設定されたメタデータ プロパティ true AffectsMeasure

適用対象