public static ToByteArray ( this image, |
||
image | this | The image to convert |
format | The format of the image | |
Résultat | byte[] |
public static byte[] ToByteArray(this Image image, ImageFormat format)
{
using (MemoryStream ms = new MemoryStream())
{
image.Save(ms, format);
return ms.ToArray();
}
}