StretchDirection 枚举
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
描述如何对内容应用缩放,并限制对已命名像素类型的缩放。
public enum class StretchDirection
C#
public enum StretchDirection
type StretchDirection =
Public Enum StretchDirection
- 继承
名称 | 值 | 说明 |
---|---|---|
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 |