StretchDirection 列舉
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
描述縮放比例如何套用至內容,並限制具名軸類型的縮放比例。
public enum class StretchDirection
C#
public enum StretchDirection
type StretchDirection =
Public Enum StretchDirection
- 繼承
名稱 | 值 | Description |
---|---|---|
Both | 2 | 內容會根據 Stretch 模式自動縮放以符合父代。 |
DownOnly | 1 | 只有當內容大於父代時,才會縮小。 如果內容較小,不會放大。 |
UpOnly | 0 | 只有當內容小於父代時,才會放大。 如果內容較大,不會縮小。 |
下列範例示範如何使用程式碼建立 和 Viewbox 設定 StretchDirection 內容的實例。
// 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;
C#
// 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
產品 | 版本 |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |