C#: Image to byte array 2
Image to byte array 2
public static class ImageExtentions { public static byte[] ToByteArray(this Image image, ImageFormat imageFormat) { using (MemoryStream ms = new MemoryStream()) { image.Save(ms, imageFormat); return ms.ToArray(); } } }
Tag: C#, Extensions, image
0 Comments