开发者

How do you procedurally rotate an image in WPF?

开发者 https://www.devze.com 2023-01-13 17:03 出处:网络
I want procedurally rotate an image in WPF. 开发者_高级运维 I\'ve seen how to bind a rotation to a control.But, I want to bind the rotation to an object\'s angle.How do I do that?<Image Source=\"{B

I want procedurally rotate an image in WPF. 开发者_高级运维 I've seen how to bind a rotation to a control. But, I want to bind the rotation to an object's angle. How do I do that?


<Image Source="{Binding ElementName=ImageList,Path=SelectedItem.Image}">
   <Image.LayoutTransform>
      <RotateTransform Angle="{Binding RotationProperty}"/>
   </Image.LayoutTransform>
</Image>

Source + more info: http://www.nbdtech.com/Blog/archive/2007/11/15/wpf-image-viewer-part-7-rotating-the-image-with-a.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消