开发者

How to make a image swivel in wpf?

开发者 https://www.devze.com 2023-03-31 23:56 出处:网络
I was looking at this post. I was wondering if it was possible to make a image swivel in wpf? If not, how would i change the s开发者_如何学Goolution to make my WPF image swivel repeatedly?I found th

I was looking at this post.

I was wondering if it was possible to make a image swivel in wpf?

If not, how would i change the s开发者_如何学Goolution to make my WPF image swivel repeatedly?


I found this simple solution:

This is all you need.

<pl:Planerator Name="planerator">
        <Image Name="logo"
           Source="somePath" >
            <Image.Triggers>
                <EventTrigger RoutedEvent="Image.Loaded">
                    <BeginStoryboard>
                        <Storyboard TargetProperty="ScaleX" RepeatBehavior="Forever">
                            <DoubleAnimation Storyboard.TargetName="planerator" 
                                             Storyboard.TargetProperty="RotationY"
                                             From="0" To="360"
                                             BeginTime="0:0:0"
                                             Duration="0:0:5"  
                                             AutoReverse="False"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </Image.Triggers>
        </Image>
    </pl:Planerator>
0

精彩评论

暂无评论...
验证码 换一张
取 消