B
bh
I have a Function in an external class, that accepts a byte array and tries
to convert it to a .bmp image, but I'm getting "A generic error occurred in
GDI+" exception error on the 3rd line when I try to save the image. The
code I have is as follows. Any help you can offer would be appreciated.
Thank you in advance:
Public Overloads Shared Function ResizeImage(ByVal ImageBytes As Byte(),
ByVal width As Integer, ByVal height As Integer) As Bitmap
Dim ms As New MemoryStream(ImageBytes, 0, ImageBytes.Length)
Dim imgIn As System.Drawing.Image = System.Drawing.Image.FromStream(ms,
True)
imgIn.Save(ms, Imaging.ImageFormat.Bmp)
remaining code...
to convert it to a .bmp image, but I'm getting "A generic error occurred in
GDI+" exception error on the 3rd line when I try to save the image. The
code I have is as follows. Any help you can offer would be appreciated.
Thank you in advance:
Public Overloads Shared Function ResizeImage(ByVal ImageBytes As Byte(),
ByVal width As Integer, ByVal height As Integer) As Bitmap
Dim ms As New MemoryStream(ImageBytes, 0, ImageBytes.Length)
Dim imgIn As System.Drawing.Image = System.Drawing.Image.FromStream(ms,
True)
imgIn.Save(ms, Imaging.ImageFormat.Bmp)
remaining code...