C# Bitmap类型与Byte[]类型相互转化
C# Bitmap类型与Byte[]类型相互转化Bitmap => byte[]Bitmap b = new Bitmap( "test.bmp "); MemoryStream ms = new MemoryStream(); b.Save(ms,System.Drawing.Imaging.ImageFormat.Bmp); byte[] bytes= ms.GetBuffer(); //byte[] b