How to make a image swivel in wpf?

我的梦境 提交于 2019-12-25 12:38:08

问题


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 solution to make my WPF image swivel repeatedly?


回答1:


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>


来源:https://stackoverflow.com/questions/7228373/how-to-make-a-image-swivel-in-wpf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!