Stretch 列挙型

定義

割り当てられた領域を埋めるためにコンテンツのサイズを変更する方法について説明します。

public enum class Stretch
public enum Stretch
type Stretch = 
Public Enum Stretch
継承

フィールド

名前 説明
None 0

コンテンツは元のサイズを保持します。

Fill 1

コンテンツのサイズが変更され、コピー先のディメンションに合わせて調整されます。 縦横比は保持されません。

Uniform 2

コンテンツは、ネイティブの縦横比を維持しながら、コピー先のサイズに合わせてサイズが変更されます。

UniformToFill 3

コンテンツは、ネイティブの縦横比を維持しながら、コピー先の寸法に合わせてサイズが変更されます。 コピー先の四角形の縦横比がソースと異なる場合、コピー元のコンテンツはコピー先の寸法に収まるようにクリップされます。

次の例では、コードを使用して 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 の設定
ストレッチ値

適用対象