NinethSense oWnZ mE!: Praveen’s drawing book

Choose a Topic:

Mon
28
Jan '08

Beginner’s WPF Animation tutorial




My article for ‘Beginners WPF Animation’ is availble on codeproject.com.

Check the CodeProject article at http://www.codeproject.com/KB/WPF/WPFAnimation.aspx
'

WPF - running wheel animation

We can make a rotate animation with image1.RenderTransformOrigin = new Point(0.5, 0.5); so that we will make the feeling wheel is rotating. Here is the code:
 
 DoubleAnimation da = new DoubleAnimation(360, 0, new Duration(TimeSpan.FromSeconds(3)));
RotateTransform rt = new RotateTransform();
image1.RenderTransform = rt;
image1.RenderTransformOrigin = new Point(0.5, 0.5);
da.RepeatBehavior = RepeatBehavior.Forever;
rt.BeginAnimation(RotateTransform.AngleProperty, da);
More detailed version is available at http://www.digitalmanic.com/index.php?title=Beginners_Animation_tutorial_-_Rotate_2
The CodeProject Microsoft Developer Network Official ASP.NET Forums Microsoft .NET Framework Community Microsoft Most Valuable Professional Kidoos forums Microsoft Visual Studio Developer Home Professional Information Technology Solutions Microsoft Research Home Trivandrum Microsoft Users Group Community Website