C#——image与byte数组的转换

image to byte[]

MemoryStream ms=new MemoryStream();

image.Save(ms,System.Drawing.Imaging.ImageFormat.Gif );

byte[] imagedata=ms.GetBuffer ();

 

byte[] to image

MemoryStream ms = new MemoryStream(imagedata);

img = Drawing.Image.FromStream(ms);

 

你可能感兴趣的:(image)