如何使WPF中的图像旋转? [英] How to make a image swivel in wpf?

查看:424
本文介绍了如何使WPF中的图像旋转?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在看这个职务。

我想知道是否有可能使WPF中的图像旋转?

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

如果没有,我如何改变解决方案,使我的WPF图像旋转反复?

If not, how would i change the solution to make my WPF image swivel repeatedly?

推荐答案

我发现<一个href=\"http://blogs.msdn.com/b/greg_schechter/archive/2007/10/26/enter-the-planerator-dead-simple-3d-in-wpf-with-a-stupid-name.aspx\"相对=nofollow>这个的简单解决方案:

I found this simple solution:

这是你所需要的。

<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>

这篇关于如何使WPF中的图像旋转?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆