Hi,

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

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

Jump to Post

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 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.