S
Samuel
Hello coders:
How do I save the image painted on a Graphics object into a file?
I get an exception when I try to do:
Image.FromHbitmap(
pictureBox.CreateGraphics().GetHdc()
).Save("C:\location\file.jpg")
The exception is:
An unhandled exception of type
'System.Runtime.InteropServices.ExternalException' occurred in
system.drawing.dll
Additional information: A generic error occurred in GDI+.
I'm sure it must be an easy way to save the changes made on a PictureBox.
Thank you. Samuel.
How do I save the image painted on a Graphics object into a file?
I get an exception when I try to do:
Image.FromHbitmap(
pictureBox.CreateGraphics().GetHdc()
).Save("C:\location\file.jpg")
The exception is:
An unhandled exception of type
'System.Runtime.InteropServices.ExternalException' occurred in
system.drawing.dll
Additional information: A generic error occurred in GDI+.
I'm sure it must be an easy way to save the changes made on a PictureBox.
Thank you. Samuel.