Ievgen
Ievgen

Reputation: 4443

How can I get real point position of WPF Polyline points?

I am trying to draw some marks (red circles) over my WPF PolyLine points.

So I can get position of each PolyLine.Point and draw my mark.

enter image description here

And this is ok, but problem appears when Polyline Stretch is applied!

So when Stretch is applied point coordinates not equals to real position of point on screen.

enter image description here

Any ideas how to get real point position on screen when Stretch is applied?

Upvotes: 1

Views: 2199

Answers (1)

Clemens
Clemens

Reputation: 128147

You may use the Transform from the Polyline's RenderedGeometry:

var transform = polyline.RenderedGeometry.Transform;

foreach (var point in polyline.Points)
{
    var transformedPoint = transform.Transform(point);
}

Upvotes: 1

Related Questions