Pergunta

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?

Foi útil?

Solução

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);
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top