I have a DrawingVisual like this:
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));
}
I want to get the Geometry which describes the area of the element, in this case a RectangleGeometry where Rect property is:
Rect(new Point(50, 50), new Size(200, 200))
Thanks.