Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

why does a rotation animation pause a second?

$
0
0

Hi All,

I need to rotate a picture forever and change rotation ratio sometimes. My code is:

<Image x:Name="image" Source="cpuspin-icons.ico" 
                    MaxWidth="250" MaxHeight="250" RenderTransformOrigin="0.5,0.5"><Image.RenderTransform><RotateTransform x:Name="TransRotate" CenterX="0" CenterY="0" Angle="0" /></Image.RenderTransform><Image.Resources><Storyboard x:Key="spin"><DoubleAnimation x:Name="da" 
                                Storyboard.TargetName="TransRotate" 
                                Storyboard.TargetProperty="Angle"
                                By="360" 
                                Duration="0:1:40"  
                                AutoReverse="False" 
                                RepeatBehavior="Forever" /></Storyboard></Image.Resources><Image.Triggers><EventTrigger RoutedEvent="FrameworkElement.Loaded"><EventTrigger.Actions><BeginStoryboard x:Name="cpuspin" Storyboard="{StaticResource spin}" /></EventTrigger.Actions></EventTrigger></Image.Triggers></Image>

this.cpuspin.Storyboard.SetSpeedRatio(this.image, 12.0);

The image is a circle. it works. but there is a problem: Sometimes the rotation will be paused a second. The rotation will work forever but sometimes it looks like a "jump", looks like the end point after rotating a circle is not the start point of the new circle. My English is bad, I am not sure I describe the appearance clear or not.

Any ideas? Thanks a lot.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>