日期:2014-05-17 浏览次数:21252 次
public static byte[] BitmapTObyte(Bitmap 图) { MemoryStream ms = new MemoryStream(); 图.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); byte[] bt = ms.GetBuffer(); ms.Close(); return bt; } public static Bitmap BitmapTObyte(byte[] content) { MemoryStream ms = new MemoryStream(); ms.Write(content, 0, content.Length); Bitmap myBitmap = new Bitmap(ms); ms.Close(); return myBitmap; }