WP7 Silverlight 上基于帧的动画
来自 iOS 世界,我们有 UIImageView 和属性animationImages: http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImageView_Class/Reference/Reference.html#//apple_ref/occ/instp/UIImageView/animationImages
其中AnimationImages 只是任意动画帧的数组。您指定图像(可能是 15 个),然后在其他属性之一中设置总动画时间(可能是 4 秒),然后启动动画,animationImages 中的图像将以均匀的帧速率在指定时间内按顺序播放。
我如何对 WP7/Silverlight 执行同样的操作?这一切表达混合看起来很棒,但我只是找不到一种方法来动画图像源(我猜这可能是不可能的)。我会怎样做同样的事情?我是否应该为动画中的每个帧添加一个唯一的图像对象,然后使用可见性/不透明度属性并手动创建所有间隔开的关键帧?这听起来像是很多额外的工作+开销,这不是一个好方法......
Coming from the iOS world where we have UIImageView and the property animationImages:
http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImageView_Class/Reference/Reference.html#//apple_ref/occ/instp/UIImageView/animationImages
Where animationImages is just an array of arbitrary animation frames. You specify the images (maybe 15), then set the total animation time (maybe 4 seconds) in one of the other properties, then just start the anim and the images in animationImages will play sequentially over the specified time with an even frame rate.
How would I do the same with WP7/Silverlight? This all Expression Blend seems wonderful, but I just can't find a way to animate the image source (I'm guessing it might be impossible). How would I do the same? Should I add a unique image object for each frame in the animation, then play around with visibility/opacity properties and manually have to create all the spaced out key frames? That sounds like a lot of extra work + overhead and not a nice way to go...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
http://www.windowsphonegeek.com/文章/WP7-动画深入ndash-概述和入门
http://www.wearerighteous.com /wp7-development/xaml-animation-in-silverlight-for-windows-phone-7/
http://www.windowspresentationfoundation.com/?p=712
尝试这些链接。尤其是第一个,我想第一个就解决了你所有的疑惑。在 wp7 中,我们可以选择两种选项:基于 XAML 的(静态)动画/或借助 C# 代码。通过使用混合,你可以毫无问题地创建所有静态动画。这里的动画是在页面框架的基础上工作的。如果您有兴趣了解更多有关动画的信息,也可以尝试一下;
http://msdn.microsoft.com/en -us/library/cc189019(v=vs.95).aspx
http://www.windowsphonegeek.com/articles/WP7-Animations-in-depthndash-Overview-and-Getting-Started
http://www.wearerighteous.com/wp7-development/xaml-animation-in-silverlight-for-windows-phone-7/
http://www.windowspresentationfoundation.com/?p=712
Try out these links. Especially the first one, I think the first one resolve all you doubts. In wp7 we can go for two options either XAML based (static) animations / or with the help of C# code. By using blend u can create all sot of static animation with out any issue. Here the animation is working on the basis of page frames. If u are interested in learning more about Animation try this too;
http://msdn.microsoft.com/en-us/library/cc189019(v=vs.95).aspx
您实际上可以对 Image.Source 属性进行动画处理,这是一个教程。
在 WP7 中制作图像动画
You can actually animate the Image.Source property here's a tutorial.
Animating Images in WP7