Rotating Viewbox contents smoothly

Posted by user204562 on Stack Overflow See other posts from Stack Overflow or by user204562
Published on 2010-06-13T14:54:43Z Indexed on 2010/06/13 15:02 UTC
Read the original article Hit count: 155

Filed under:
|
|
|

I'm looking to teach myself better methods of doing things in WPF that I would normally do manually.

In this case, I have a ViewBox with an image in it. I also have a button that uses a DoubleAnimation to rotate the image 90 to the right.

This animation works fine, but obviously because it's square as it turns, the image does a "best fit" to the ViewBox which makes the rotation look quite bad, as it gets larger and smaller as its longest edge shrinks or grows to fit to that particular rotation angle.

I am looking for any advice on the best way to handle this using appropriate WPF methods. Obviously I could do all the calculations manually, but I would be more interested in finding a way to use the controls and methods built into the .NET architecture.

Thanks for your help.

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf