public static byte[] Image2Byte(System.Drawing.Image image) { // make a memory stream to work with the image bytes MemoryStream imageStream = new MemoryStream(); // put the image into the memory stream image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Jpeg); return imageStream.GetBuffer(); }