【问题标题】:How can I get real point position of WPF Polyline points?如何获得 WPF 折线点的实际点位置?
【发布时间】:2013-10-03 21:27:31
【问题描述】:

我正在尝试在我的 WPF 折线点上绘制一些标记(红色圆圈)。

所以我可以获得每个 PolyLine.Point 的位置并绘制我的标记。

这没问题,但是当 Polyline Stretch 应用时出现问题!

所以当 Stretch 被应用时,点坐标不等于屏幕上点的实际位置。

当应用 Stretch 时,任何想法如何在屏幕上获得真实的点位置?

【问题讨论】:

    标签: c# wpf coordinates polyline coordinate-transformation


    【解决方案1】:

    您可以使用折线的RenderedGeometry 中的Transform

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-18
      • 1970-01-01
      • 1970-01-01
      • 2012-09-17
      • 2014-03-19
      相关资源
      最近更新 更多