Thursday, March 8, 2012

How to convert image into byte array

Following is the function which will return bytes array after converting from image....

 public byte[] imageToByteArray(System.Drawing.Image imageIn)
 {
     MemoryStream ms = new MemoryStream();
     imageIn.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
     return ms.ToArray();
 }

No comments:

Post a Comment