Re: How to change the size of the canvas?



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.





active wrote:
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


.



Relevant Pages

  • Re: Double Buffering to draw lines
    ... #1 Don't use GetGraphics to obtain a graphics object to draw onto. ... #2 Don't draw in event handlers that are not meant for drawing. ... Find great Windows Forms articles in Windows Forms Tips and Tricks ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Draw Line of Form?
    ... that creates a graphics object for the control when it's first instantiated ... > whether it's GDI, GDI+ or Avalon doing the drawing. ... > Find great Windows Forms articles in Windows Forms Tips and Tricks ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Drawing lines - another noob question
    ... graphics object just draws within the form you already have generated. ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... I want to be able to draw ... lines in a picturebox based upon certain data points I have received. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Drawing outside the box
    ... create a Graphics object and draw on that.. ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... I can't do this using CreateGraphics on either the control or its ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Double buffering with pagescale
    ... Graphics object obtained from a bitmap doesn't support page-scaling. ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... > Without double buffering, increasing the pagescale magnifies ...
    (microsoft.public.dotnet.framework.drawing)