关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

C# bitmap转换为字节流

发布时间:2019-12-09 18:29:23

 public static byte[] BitmapByte(Bitmap bitmap)

        {

            using (MemoryStream stream = new MemoryStream())

            {

                bitmap.Save(stream, ImageFormat.Jpeg);

                byte[] data = new byte[stream.Length];

                stream.Seek(0, SeekOrigin.Begin);

                stream.Read(data, 0, Convert.ToInt32(stream.Length));

                return data;

            }

        }



/template/Home/Zkeys/PC/Static