get Bytes from Bitmap - CSharp System.Drawing

CSharp examples for System.Drawing:Image Convert

Description

get Bytes from Bitmap

Demo Code


using System.Drawing.Imaging;
using System.Drawing;
using System.Text;
using System.Collections.Generic;
using System.IO;// w  w  w.  j  a  v a  2  s  . c  om
using System;

public class Main{
        public static  byte [] getBytes(Bitmap imgSource)
        {

            MemoryStream ms = new MemoryStream();
            imgSource.Save(ms, ImageFormat.Bmp);
            return ms.ToArray();
        }
}

Related Tutorials