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?

有帮助吗?

解决方案

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);
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top