我想缩放它并旋转它。但我的控制只需要一个转变作为它.RenderTransform
。
如何添加 ScaleTransform 和 Rotatetransform?
我想缩放它并旋转它。但我的控制只需要一个转变作为它.RenderTransform
。
如何添加 ScaleTransform 和 Rotatetransform?
这取自MSDN
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
<StackPanel Margin="50">
<Button
RenderTransformOrigin="0.5,0.5"
HorizontalAlignment="Center">Click
<Button.RenderTransform>
<!-- TransformGroup enables you to apply multiple transforms. In
this example, the button is scaled and rotated. -->
<TransformGroup>
<!-- Triple the size (scale) of the button in the Y direction. -->
<ScaleTransform ScaleY="3" />
<!-- Rotate the button by 45 degrees. -->
<RotateTransform Angle="45" />
</TransformGroup>
</Button.RenderTransform>
</Button>
</StackPanel>
</Page>