1
我有幾個隨機大小的畫布對象並應用RenderTransform角度。 內部畫布我有幾何對象(線)。WPF如何檢查應用轉換時的幾何交叉點?
我正在使用綁定的寬度和高度來加載父路徑畫布對象的路徑。
<Path x:Name="gem2_Copy" Stretch="Fill" Stroke="Black" Opacity="0.345" RenderTransformOrigin="0.5,0.5" Width="{Binding ActualWidth, ElementName=canvas}" Height="{Binding ActualHeight, ElementName=canvas}">
<Path.Data>
<PathGeometry>
<PathFigure IsClosed="True" IsFilled="True">
<LineSegment Point="0,0">
</LineSegment>
<LineSegment Point="5,5">
</LineSegment>
<LineSegment Point="0,5">
</LineSegment>
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>
如何檢查的PathFigure與其他道路相交的幾何? 我algoritm檢查線交叉,但由於路徑分線點我可以不適用它始終是: 0,0 5,5 0,5
,我需要全局座標。我怎樣才能將路徑點轉換爲全局座標,並考慮到渲染轉換角度改變,路徑寬度和高度改變?
foreach (var figure in geom.Figures)
{
foreach (LineSegment segment in figure.Segments)
{
// I have here 0,0;5,5;0,5
}
}