Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 08, 2010 02:59 AM by jean quiero
May 13, 2007 03:22 AM|LINK
i'm storing an image in a database, when i pull it out i'm converting the binary data to an image, using thing following method:
//---- create a memory stream from the byte array
using (Stream stream = new MemoryStream(byteArray, true))
stream.Write(byteArray, 0, byteArray.Length);
//---- create and return a new bitmap from that stream
return System.Drawing.Bitmap.FromStream(stream, true);
but when i call it i'm getting the error, "Paramter is not valid." on the FromStream() call.any ideas on how to debug this? it's a classic gdi+ error case where it gives me no information about what's actually going on.
May 16, 2007 12:04 AM|LINK
ImageConverter imageConverter = new System.Drawing.ImageConverter();
Image image = imageConverter.ConvertFrom(byteArray) as Image;
Jan 08, 2010 02:59 AM|LINK
thanks to you man, you save my day.....
this code works perfect