开发者

WPF: How do I implement a stretch transform?

I am trying to implement an effect that will stretch a polygon along a line from its center point to the mouse location. I've tried various approaches with a SkewTransform and the planar angle between those two points开发者_运维问答 but that isn't giving me what I want.

I am kind of assuming I'll have to go the MatrixTransform route but my linear algebra is pretty rusty.


You can either use the ScaleTransform and just apply it in one direction then combine it with a RotateTransform if the direction you need to stretch in isn't just plain x or y, or take a look at the Stretch property on the shape.

There's a good article on CodeProject that has some examples.

MSDN also has some reference material.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜