如何使用 doubleanimation / pointanimation 对折线点进行动画处理
假设我有一条折线,并且我希望使用动画仅将折线的末端从 A 移动到 B。我应该怎样去做呢?
p/s:如果建议是针对折线而不是针对路径等其他控件,我仍然会更喜欢:)
Assuming I have a Polyline and I wish to move only the end of the Polyline from A to B using animation. How should I go about doing it?
p/s: I'll still prefer if the suggestion is for polyline and not for other controls such as path and so on :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,不可能开箱即用,因为您正在尝试为
PointCollection
内的Point
制作动画。您真正需要的是一个PointCollectionAnimation
,而 WPF 并未提供。然而,出色的 Charles Petzold 不久前写了这篇文章,向您展示了如何你可以去做。Not possible out of the box as far as I'm aware, since you're trying to animate a
Point
within aPointCollection
. What you really need is aPointCollectionAnimation
, which WPF doesn't provide. However, the awesome Charles Petzold wrote this article some time ago showing you how you can go about it.由于已接受的答案中提到的链接不再有效,因此我发布了我的方法。
As the link mentioned in the accepted answer doesn't work anymore, so I am posting my approach.