如何将imagelist中的一个图片项转换成字节数组
最近做项目需要用到将图片转换成字节数组,但是想不出有什么办法可以实现,不采用文件流哪位大哥大姐可以帮个忙咯 --------------------编程问答--------------------
Image img = this.imageList1.Images[0];--------------------编程问答--------------------
System.IO.MemoryStream _ImageMem = new System.IO.MemoryStream();
img.Save(_ImageMem, System.Drawing.Imaging.ImageFormat.Bmp);
byte[] _ImageBytes = _ImageMem.GetBuffer();
ImageList list=...;--------------------编程问答-------------------- MemoryStream ms=new MemoryStream();
Image img=list.Images[0];
MemoryStream ms=new MemoryStream();
img.Save(ms,ImageFormat.Bmp);
byte[] buf=ms.GetBuffer();
ms.Close();
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)
--------------------编程问答--------------------
public byte[] imageToByteArray(System.Drawing.Image imageIn)--------------------编程问答-------------------- hehe~``` --------------------编程问答-------------------- 谢谢各位哈。。。。谢谢。。
{
MemoryStream ms = new MemoryStream();
imageIn.Save(ms,System.Drawing.Imaging.ImageFormat.Gif);
return ms.ToArray();
}
--------------------编程问答-------------------- 学习中
补充:.NET技术 , C#