Smooth animation WPF

518 Views Asked by At

I have an animation that is making an image wheel rotate forever. Here is my code:

<Image Name="BigWheelImage"  
               Source="{DynamicResource BigWheel}" 
               Height="400" 
               Width="400" >
            <Image.RenderTransform>
                <RotateTransform 
                    CenterX="200" 
                    CenterY="200" />
            </Image.RenderTransform>
            <Image.LayoutTransform>
                <TranslateTransform X="0" Y="0" />
            </Image.LayoutTransform>
            <Image.Style>
                <Style>
                    <Style.Triggers>
                        <Trigger Property="Image.IsEnabled" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard RepeatBehavior="Forever" DesiredFrameRate="30">
                                        <DoubleAnimation Storyboard.TargetProperty="RenderTransform.Angle"
                                                From="360" To="0" Duration="0:0:35" BeginTime="00:00:00.000" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </Image.Style>
        </Image>

But when I run the application, the wheel is not rotating smoothly. It "jumps". I tried to modify the DesiredFrameRated as I read here, but with no luck.

Any idea on how to make the animation look smoothly?

0

There are 0 best solutions below