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.
精彩评论