WPF - running wheel animation
Filed in WPF-WCF-WF on Jan.28, 2008
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
Related posts:























Leave a Reply
You must be logged in to post a comment.