Image to Byte Array and Byte Array to Image Converter Class




public byte[] imageToByteArray(System.Drawing.Image imageIn)

{

    MemoryStream ms = new MemoryStream();

    imageIn.Save(ms,System.Drawing.Imaging.ImageFormat.Gif);

    return ms.ToArray();

}

No comments: