DrawString in Canvas ,How to save it as a picture?

DrawString in Canvas ,How to save it as a picture?

Create a picture the same size as the canvas, and Drawinto the canvas to the picture graphics.

or better yet… create a Picture object, do all the drawing THERE
and just use the Canvas PAINT event to display the PICTURE, I bet you get better quality output that way

There are many ways to accomplish this. I would also recommend Dave’s approach.
Create a Picture Object and do all your Drawing there.
Draw the Picture into the Canvas (use the Paint Event of the Canvas for this) and use Picture.Save to save it to Disk.

To be more precise regarding the Canvas:

The Picture Object should be a Property of the Window, Module or so. So it will stay alive as long as you need it.
In the Canvas you just need to write something like:

g.Graphics.DrawPicture(PictureObject, 0,0)

This way the Canvas will automatically be refreshed when a refresh is needed.