无尽的动画?
是否有可能使 DoubleAnimation 永远持续下去(没有循环,只是继续而不停止)?
Is it possible to make DoubleAnimation continue forever (no loop, just continue without stop)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
WPF 中的动画和 StoryBoard 有一个 RepeatBehavior 属性,您可以将其设置为“永远”。这将告诉你的动画永远重复,直到你告诉它停止。
http://msdn.microsoft.com /en-us/library/system.windows.media.animation.timeline.repeatbehavior.aspx
Animations and StoryBoards in WPF have a RepeatBehavior property that you can set to "Forever". This will tell your animation to repeat forever until you tell it to stop.
http://msdn.microsoft.com/en-us/library/system.windows.media.animation.timeline.repeatbehavior.aspx
由于技术上不可能永远继续动画(Double 有一定的最大值),因此您可以获得的最接近的动画是在您应该能够计算的相应时间内为 Double.MaxValue 制作动画。
但是,如果您告诉我们您到底需要该动画的用途,我们也许可以为您提供更好的解决方案。
Since it is technically impossible to continue the animation forever (Double has a certain maximum value), the closest you could get is animate to Double.MaxValue in the according amount of time you should be able to calculate.
However, we may be able to give you a better solution if you tell us what exactly you need this animation for.
没有循环意味着您有新的帧要在动画中显示。所以这个问题相当于“我能制作一部永远放映的电影吗?”除非你可以自动生成一些动画内容(这在计算上是完全可行的) - 答案是“不”。
然而,对于“无尽”动画的示例,请查看在线的许多 Flash 页面中的任何一个。例如;
http://flintarticles.org/blog/examples
Without a loop implies you have new frames to display in the animation. So this question is equivalent to "can I produce a movie than runs forever?" Unless you can automatically generate some animation content (which computationally is perfectly feasible) - the answer is "no".
However, for examples of "endless" animations, look at any of the many flash pages online. For example;
http://flintparticles.org/blog/examples