I am dealing with the shape drawing functions in C# and I am trying to resize DrawingGroup after drawing some shapes on it.
Here is my code:

DrawingGroup drawingGroup = new DrawingGroup();
Pen redPen = new Pen( Brushes.Red, 2 );
DrawingContext drawingContext = drawingGroup.Open()
drawingContext.DrawRectangle( null, redPen, rect);
double scale = 1.5;
DrawingGroup resizedDrawingGroup = ?

How can I resize "drawingGroup"? Is it even possible?

Recommended Answers

All 2 Replies

First there are prior discussions on that so I'll keep it short. When you resize you redraw the contents. Most examples have a handler that does this for the object. Pausing here so to not duplicate the web.

A DrawingGroup has a Transform property. You could feed it a ScaleTransform object.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.