![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | Rotate Control in C# I like to rotate a image control by using animation and control in coding. I am using DoubleAnimation and set from and to for the rotation. I have trouble to set DepedencyProperty for the rotation. Is any one show me how to set it in C# code ? Thanks |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Rotate Control in C# Shouldn't you be using MatrixAnimation? -- Vipin Aravind http://www.explorewindows.com "MyWebTV" <MyWebTV@discussions.microsoft.com> wrote in message news:E3B1D437-F8B7-46FB-82AA-6FE04A310D27@microsoft.com... >I like to rotate a image control by using animation and control in coding. >I > am using DoubleAnimation and set from and to for the rotation. I have > trouble > to set DepedencyProperty for the rotation. Is any one show me how to set > it > in C# code ? > > Thanks |
My System Specs![]() |
| | #3 (permalink) |
| | RE: Rotate Control in C# Here is a simple way of doing a rotation animation on an image without using matrices. Code: //Create new image object Image myImage = new Image(); //Create a rotation transform RotateTransform rotateTransform = new RotateTransform(0); //Apply the transform to the image myImage.RenderTransform = rotateTransform; //Create a new double animation DoubleAnimation doubleAnimation = new DoubleAnimation(); doubleAnimation.From = 0; //Set From value doubleAnimation.To = 180; //Set To Value doubleAnimation.Duration = 10; //Time it takes to do the animation //After the animation is complete hold the last value doubleAnimation.FillBehavior = FillBehavior.HoldEnd; //Begin the animation on the rotation animation rotateTransform.BeginAnimation(RotateTransform.AngleProperty, doubleAnimation); In your case I don't think you need to resort to using MatrixAnimations. Hope this helps, Andrew C "MyWebTV" wrote: > I like to rotate a image control by using animation and control in coding. I > am using DoubleAnimation and set from and to for the rotation. I have trouble > to set DepedencyProperty for the rotation. Is any one show me how to set it > in C# code ? > > Thanks |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Rotate video clip | Vista music pictures video | |||
| Rotate picture by degrees | Vista music pictures video | |||