WPF - 如何以编程方式从DrawingImage获取GeometryDrawing.Geometry?

时间:2015-01-06 09:32:44

标签: wpf geometry geometrydrawing

我正在尝试以编程方式获取 几何图标= myDrawingImageobj.SOMETHING

有没有办法从绘图图像中提取几何数据?

1 个答案:

答案 0 :(得分:0)

如果DrawingImage的Drawing属性实际上包含GeometryDrawing,您可以简单地将其转换为:

var geometryDrawing = (GeometryDrawing)myDrawingImageobj.Drawing;
var icon = geometryDrawing.Geometry;