旋转转换问题 [英] rotate transformation problem
本文介绍了旋转转换问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我在正确的方向上旋转标签时,
when i rotate a label in the right direction
但旋转点不是标签的(0.0)(...因为它需要一个新的位置)
but the rotation point isn't (0.0) of the label (... by that it takes a new position)
然后当我按相反方向旋转它时它会旋转但是从旧(开始)
and then when i rotate it in the reversed direction it rotates but from the old(start)
位置而不是从新位置
推荐答案
如果要围绕其中心旋转控件,则应将RenderTransformOrigin属性设置为(0.5,0.5)。它默认为(0,0),这意味着控件将围绕其边界框的左上角旋转。有关更多信息,请参阅以下
页面:
http://msdn.microsoft.com/en-US/library/windows.ui.xaml.media.rotatetransform.ASPX
<Grid Background="Yellow" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Left">
<TextBlock>Text...</TextBlock>
<Grid.RenderTransform>
<RotateTransform Angle="45"/>
</Grid.RenderTransform>
</Grid>
请记得通过点击以下链接将有用的帖子标记为答案来关闭您的主题有用的帖子。
And please remember to close your threads by marking helpful posts as answer by clicking on the link below the helpful post.
这篇关于旋转转换问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文