简体   繁体   English

如何获得WPF折线点的真实点位置?

[英]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. 我试图在WPF PolyLine点上绘制一些标记(红色圆圈)。

So I can get position of each PolyLine.Point and draw my mark. 这样我就可以获取每个PolyLine.Point的位置并绘制标记。

在此处输入图片说明

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. 因此,当应用“ 拉伸”时,点坐标不等于屏幕上点的实际位置。

在此处输入图片说明

Any ideas how to get real point position on screen when Stretch is applied? 有任何想法如何在应用“ 拉伸”时获取屏幕上的真实点位置?

You may use the Transform from the Polyline's RenderedGeometry : 您可以使用折线的RenderedGeometryTransform

var transform = polyline.RenderedGeometry.Transform;

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM