Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Graphics to Image 1

Status
Not open for further replies.

MaxZak

Programmer
Oct 5, 2001
116
IT
Is there a way to convert the contents of a System.Drawing.Graphics object to a System.Drawing.Image object?

Thanks
 
there is a logical mistake here.
graphics is an object that belongs to an image object.
we may call graphics object as drawing and painting layer of an image.
if you only want to draw something and save/process it you should first create a new bitmap, then get it's graphics object and draw anything you want.
then when u save bitmap object you'll get your drawing.
one important point here is the background color of your drawing.
you can change this by drawing a filled rectangle on graphics object that you extracted from bitmap object with the brush which has the color that you want. this color may even be transparent.

hope this helps
@li
 
Tank you, now is clear and... it works!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top