我有一个像这样的DrawingVisual:
Rect MyRect = new Rect(new Point(0, 0), new Size(100, 100));
DrawingVisual MyVisual = new DrawingVisual();
using (DrawingContext context = MyVisual.RenderOpen()) {
context.DrawRectangle(Brushes.Black, new Pen(), MyRect);
context.PushTransform(new TranslateTransform(50, 50));
context.PushTransform(new ScaleTransform(2, 2));
}
我想获得描述元素区域的几何,在这种情况下是RectangleGeometry,其中 Rect 属性是:
Rect(new Point(50, 50), new Size(200, 200))
谢谢。