随笔- 77  评论- 13  文章- 0 

[C#]image与byte数组的转换

image to byte[]

  MemoryStream ms=new MemoryStream();
   byte[] imagedata=null;
   pictureBox1.Image.Save(ms,System.Drawing.Imaging.ImageFormat.Gif );
   imagedata=ms.GetBuffer ();

byte[] to image

  ms = New IO.MemoryStream(by)
  img = Drawing.Image.FromStream(ms)
posted on 2009-05-10 17:42  BoneKing  阅读(...)  评论(...编辑  收藏