views:

53

answers:

1

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.

+2  A: 

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.

Simon P Stevens