System.Drawing.Bitmap Class

Encapsulates a ndptecgdiplus bitmap, which consists of the pixel data for a graphics image and its attributes. A System.Drawing.Bitmap is an object used to work with images defined by pixel data.

See Also: Bitmap Members


[System.ComponentModel.Editor("System.Drawing.Design.BitmapEditor, System.Drawing.Design, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
public sealed class Bitmap : Image


A bitmap consists of the pixel data for a graphics image and its attributes. There are many standard formats for saving a bitmap to a file. ndptecgdiplus supports the following file formats: BMP, GIF, EXIF, JPG, PNG and TIFF. For more information about supported formats, see Types of Bitmaps.

You can create images from files, streams, and other sources by using one of the Bitmap.#ctor(string, bool) constructors and save them to a stream or to the file system with the Image.Save(System.IO.Stream, System.Drawing.Imaging.ImageCodecInfo, System.Drawing.Imaging.EncoderParameters) method. Images are drawn to the screen or to memory by using the Graphics.DrawImage(Image, Point) method of the System.Drawing.Graphics object. For a list of topics about working with image files, see Working with Images, Bitmaps, Icons, and Metafiles.


The System.Drawing.Bitmap class is not accessible across application domains. For example, if you create a dynamic AppDomain and create several brushes, pens, and bitmaps in that domain, then pass these objects back to the main application domain, you can successfully use the pens and brushes. However, if you call the Graphics.DrawImage(Image, Point) method to draw the marshaled System.Drawing.Bitmap, you receive the following exception.

Remoting cannot find field "native image" on type "System.Drawing.Image".


Namespace: System.Drawing
Assembly: System.Drawing (in System.Drawing.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0,