Question

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?

Was it helpful?

Solution

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);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top