Convert Image To Byte Array in C#
This example shows how to convert an image into a byte array.
Sample Code:
public byte[] ImageToByteArray(Image img) { MemoryStream ms = new MemoryStream(); img.Save(ms, System.Drawing.Imaging.ImageFormat.Gif); return ms.ToArray(); }
See Also:
Convert Byte Array To Image