是否可以在 Silverlight 中对 PolyLineSegment(即 PointCollection)进行动画处理?
我正在用 PathGeometry
中的菱形 PolyLineSegment
裁剪画布。我正在尝试对它的 PointCollection 进行动画处理,但似乎无法解析 TargetProperty。这是 Google 发现的唯一其他参考,这几乎就是我想要做的,并且相同的 PropertyPath
:http://forums.silverlight.net/forums/p/22239/78225.aspx
是否有可能获得积分< /code> 来自
PointCollection
以便更改其在动画中的值?
I'm clipping a Canvas I have with a diamond-shaped PolyLineSegment
in a PathGeometry
. I'm trying to animate the PointCollection of it though, and cannot seem to resolve the TargetProperty. This is the only other reference all of Google found that is pretty much what I'm trying to do and the the same PropertyPath
: http://forums.silverlight.net/forums/p/22239/78225.aspx
Is it even possible to get a Point
from a PointCollection
in order to change it's values in an animation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不幸的是,我认为不可能对 Polyline.Points 进行动画处理...
这些点对象来自“System.Windows.Point”,问题是它们的“X”和“Y”属性不是依赖属性。不幸的是,没有办法使用 DoubleAnimation 对不是依赖属性的属性进行动画处理。
在您提供的示例中,动画基于 PathFigure Segment(具有依赖属性)而不是 System.Windows.Point。
如果您想对它们进行动画处理,我会尽量避免在路径中使用 PolyLineSegement。
Unfortunately I don't think that is possible to animate the Polyline.Points...
Those points object are from "System.Windows.Point" and the problem is that their "X" and "Y" properties are not dependency properties. Unfortunately there is no way to animate a property that is not a dependency property with a DoubleAnimation.
In the example you provided the animation is based on PathFigure Segment (that have dependency properties) and not a System.Windows.Point.
I would try to avoid using the PolyLineSegement in your Path if you want to animate those.
您可以像这样对点集合进行动画处理:(
对一些线点进行动画处理 - 看起来很糟糕,但说明了点:o)
如果您想计算点并使其更平滑等,您可以用代码填充它:
绘制一个框,更改大小 - 您可以向其添加任何点并或多或少获得您想要的效果。
You could animate the point collection like this:
(animates some linepoints - looks bad but illustrates the point :o)
And if you want to compute the points and get it more smooth etc. you can fill it up in code:
Draws a box that changes size - you could add any points to it and get the effect you want more or less.