Save a System.Drawing.Graphics graphic as *.bmp
-
Hello guys! I want to save a System.Drawing.Graphics graphic as a *.bmp file, and tried it using the StreamWriter. I know this from saving text to a *.txt file, but found out, that this doesn't work with System.Drawing.Graphics graphics. Has anyone an idea how this could work, I didn't find anything useful in the MSDN library. Thanjs and best wishes.
-
Hello guys! I want to save a System.Drawing.Graphics graphic as a *.bmp file, and tried it using the StreamWriter. I know this from saving text to a *.txt file, but found out, that this doesn't work with System.Drawing.Graphics graphics. Has anyone an idea how this could work, I didn't find anything useful in the MSDN library. Thanjs and best wishes.
The following steps should work: 1. Create a new instance of a
System.Drawing.Bitmap
object. 2. Derive aGraphics
object from your bitmap by calling itsFromImage
method. 3. Perform your drawing operations using theGraphics
object. 4. Call theDispose
method on your Graphics object. 4. Save your image to a file by calling theSave
method on your bitmap object. Hope this helps.Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush
-
The following steps should work: 1. Create a new instance of a
System.Drawing.Bitmap
object. 2. Derive aGraphics
object from your bitmap by calling itsFromImage
method. 3. Perform your drawing operations using theGraphics
object. 4. Call theDispose
method on your Graphics object. 4. Save your image to a file by calling theSave
method on your bitmap object. Hope this helps.Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush