Bitmap To Memory Stream - CSharp System.Drawing

CSharp examples for System.Drawing:Image Convert

Description

Bitmap To Memory Stream

Demo Code


using System.Drawing;
using System.IO;//from   w  w w . j av  a 2  s .c  om

public class Main{
        public static MemoryStream ToMemoryStream(this Bitmap b)
        {
            MemoryStream ms = new MemoryStream();
            b.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
            return ms;
        }
}

Related Tutorials