Sunday, January 19, 2014

Saving Image To MemoryStream asp net c#

Use this function to convert image to byte array
public byte[] GetByte(System.Drawing.Image image)
{
    using (System.IO.MemoryStream m = new System.IO.MemoryStream())
    {
        image.Save(m, image.RawFormat);
        return m.ToArray();
    }
}

No comments:

Post a Comment