Groups | Blog | Home
all groups > dotnet drawing api > april 2007 >

dotnet drawing api : How to change the size of the canvas?



active
4/17/2007 4:23:43 PM
I have an image that is basically the canvas that the user draws on.
He may also be making changes to the Graphics object that is used to draw on
the canvas.
Then he wants to make the canvas bigger and continue drawing.
I know how to create the bigger Image and draw the old picture on it and
create a new Graphics object from the new Image.
However, I don't know how to make the new Image and Graphic object reflect
changes in properties he may have made.


Any suggestions

Thank

Bob Powell [MVP]
4/20/2007 12:10:18 AM
This is simple. You take the new desired size, create an image, get the
Graphics object for it. Then, paint the old image to the new graphics
object, exchange the new image for the old, destroy the old and continue
drawing...

Don't even need code to explain that :-)

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





[quoted text, click to view]
active
4/22/2007 10:21:12 AM
[quoted text, click to view]



I'm probably missing something here, but does the below accomplish this?

Thanks




[quoted text, click to view]

AddThis Social Bookmark Button