G
Guest
I currently have a picture which is stored in a "System.Drawing.Image"
variable and I want to save it as a bitmap file.
I have tried 2 different approaches and both give me the following error:
An unhandled exception of type
'System.Runtime.InteropServices.ExternalException' occurred in
system.drawing.dll
Additional information: A generic error occurred in GDI+.
The code I have tried is as follows
METHOD 1:
Dim flfile As New System.IO.FileStream(strFileName,
IO.FileMode.OpenOrCreate, IO.FileAccess.Write)
picImage.Image.Save(flfile, System.Drawing.Imaging.ImageFormat.Bmp)
flfile.Close()
METHOD 2:
picImage.Image.Save(strFileName, System.Drawing.Imaging.ImageFormat.Bmp)
In both cases strFileName is the path and name of the file to write to and
picImage is a picturebox currently displaying the image in my application.
Does anyone know what is causing the error and how I can get around it?
variable and I want to save it as a bitmap file.
I have tried 2 different approaches and both give me the following error:
An unhandled exception of type
'System.Runtime.InteropServices.ExternalException' occurred in
system.drawing.dll
Additional information: A generic error occurred in GDI+.
The code I have tried is as follows
METHOD 1:
Dim flfile As New System.IO.FileStream(strFileName,
IO.FileMode.OpenOrCreate, IO.FileAccess.Write)
picImage.Image.Save(flfile, System.Drawing.Imaging.ImageFormat.Bmp)
flfile.Close()
METHOD 2:
picImage.Image.Save(strFileName, System.Drawing.Imaging.ImageFormat.Bmp)
In both cases strFileName is the path and name of the file to write to and
picImage is a picturebox currently displaying the image in my application.
Does anyone know what is causing the error and how I can get around it?