有誰知道是否有可能將DrawingContext
保存或轉換爲Geometry
?將DrawingContext轉換爲幾何?
E.g.之後
using (DrawingContext dc = RenderOpen())
{
dc.DrawLine(penSelected, Data.MidTop, Data.MidTop + vertical);
dc.DrawLine(pen, Data.MidTop - horizontal, Data.MidTop + thickness);
dc.DrawLine(pen, Data.MidTop + vertical - thickness, Data.MidTop + horizontal + vertical);
dc.DrawText(new FormattedText(Data.Time2.ToString("0.0"), cultureinfo, FlowDirection.LeftToRight, typeface, 8, Brushes.Black),
Data.MidTop + 3 * thickness);
dc.DrawText(new FormattedText(Data.Time2.ToString("0.0"), cultureinfo, FlowDirection.LeftToRight, typeface, 8, Brushes.Black),
Data.MidTop + vertical - horizontal - 3 * thickness);
}
以某種方式將繪製的對象保存在幾何中?
問題是如何從DrawingVisual中的所有繪製內容中獲取單個幾何? – Clemens