|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Graphics to ImageHow do I save or transform a System.Drawing.Graphics object into an Image
object ? What I need is to save a Graphics on which I have drawn several shapes to a JPG or PNG file. Thanx. _____ Marco If you're in control of the creation of the Graphics object then you can do
something like this. Bitmap b = new Bitmap(100, 100); Graphics g = Graphics.FromImage(b); // Draw on the image using g.DrawEllipse(...), g.DrawLine(...), etc. b.Save(...); g.Dispose(); b.Dispose(); -- Show quoteTim Wilson ..NET Compact Framework MVP "Marco Rego" <MarcoR***@discussions.microsoft.com> wrote in message news:A0682A0C-2FFF-4340-98E0-DA5057CEE675@microsoft.com... > How do I save or transform a System.Drawing.Graphics object into an Image > object ? > What I need is to save a Graphics on which I have drawn several shapes to a > JPG or PNG file. > Thanx. > > _____ > Marco |
|||||||||||||||||||||||