Bitmap class
Applies to: desktop apps only
The Bitmap class inherits from the Image class. The Image class provides methods for loading and saving vector images (metafiles) and raster images (bitmaps). The Bitmap class expands on the capabilities of the Image class by providing additional methods for creating and manipulating raster images.
Members
The Bitmap class inherits from Image. Bitmap also has these types of members:
Constructors
The Bitmap class has these constructors.
| Constructor | Description |
|---|---|
| Bitmap::Bitmap(BITMAPINFO*,VOID*) |
Creates a Bitmap::Bitmap object based on a BITMAPINFO structure and an array of pixel data. |
| Bitmap::Bitmap(HBITMAP,HPALETTE) |
Creates a Bitmap::Bitmap object based on a handle to a Windows GDI bitmap and a handle to a GDI palette. |
| Bitmap::Bitmap(HICON) |
Creates a Bitmap object based on an icon. |
| Bitmap::Bitmap(HINSTANCE,WCHAR*) |
Creates a Bitmap::Bitmap object based on an application or DLL instance handle and the name of a bitmap resource. |
| Bitmap::Bitmap(IDirectDrawSurface7*) |
Creates a Bitmap::Bitmap object based on a DirectDraw surface. The Bitmap::Bitmap object maintains a reference to the DirectDraw surface until the Bitmap::Bitmap object is deleted or goes out of scope. |
| Bitmap::Bitmap(INT,INT,Graphics*) |
Creates a Bitmap::Bitmap object based on a Graphics object, a width, and a height. |
| Bitmap::Bitmap(INT,INT,INT,PixelFormat,BYTE*) |
Creates a Bitmap::Bitmap object based on an array of bytes along with size and format information. |
| Bitmap::Bitmap(INT,INT,PixelFormat) |
Creates a Bitmap::Bitmap object of a specified size and pixel format. The pixel data must be provided after the Bitmap::Bitmap object is constructed. |
| Bitmap::Bitmap(IStream*,BOOL) |
Creates a Bitmap::Bitmap object based on an IStream COM interface. |
| Bitmap::Bitmap(WCHAR*,BOOL) |
Creates a Bitmap::Bitmap object based on an image file. |
Methods
The Bitmap class has these methods.
| Method | Description |
|---|---|
| Bitmap::ApplyEffect(Bitmap**,INT,Effect*,RECT*,RECT*,Bitmap**) |
The Bitmap::ApplyEffect method creates a new Bitmap object by applying a specified effect to an existing Bitmap object. |
| Bitmap::ApplyEffect(Effect*,RECT*) |
The Bitmap::ApplyEffect method alters this Bitmap object by applying a specified effect. |
| Bitmap::Clone(INT,INT,INT,INT,PixelFormat) |
The Bitmap::Clone method creates a new Bitmap object by copying a portion of this bitmap. |
| Bitmap::Clone(REAL,REAL,REAL,REAL,PixelFormat) |
The Bitmap::Clone method creates a new Bitmap object by copying a portion of this bitmap. |
| Bitmap::Clone(Rect&,PixelFormat) |
The Bitmap::Clone method creates a new Bitmap object by copying a portion of this bitmap. |
| Bitmap::Clone(RectF&,PixelFormat) |
The Bitmap::Clone method creates a new Bitmap object by copying a portion of this bitmap. |
| Bitmap::ConvertFormat |
The Bitmap::ConvertFormat method converts a bitmap to a specified pixel format. The original pixel data in the bitmap is replaced by the new pixel data. |
| Bitmap::FromBITMAPINFO |
The Bitmap::FromBITMAPINFO method creates a Bitmap object based on a BITMAPINFO structure and an array of pixel data. |
| Bitmap::FromDirectDrawSurface7 |
The Bitmap::FromDirectDrawSurface7 method creates a Bitmap object based on a DirectDraw surface. The Bitmap object maintains a reference to the DirectDraw surface until the Bitmap object is deleted. |
| Bitmap::FromFile |
The Bitmap::FromFile method creates a Bitmap object based on an image file. |
| Bitmap::FromHBITMAP |
The Bitmap::FromHBITMAP method creates a Bitmap object based on a handle to a Windows GDI bitmap and a handle to a GDI palette. |
| Bitmap::FromHICON |
The Bitmap::FromHICON method creates a Bitmap object based on a handle to an icon. |
| Bitmap::FromResource |
The Bitmap::FromResource method creates a Bitmap object based on an application or DLL instance handle and the name of a bitmap resource. |
| Bitmap::FromStream |
The Bitmap::FromStream method creates a Bitmap object based on a stream. |
| Bitmap::GetHBITMAP |
The Bitmap::GetHBITMAP method creates a GDI bitmap from this Bitmap object. |
| Bitmap::GetHICON |
The Bitmap::GetHICON method creates an icon from this Bitmap object. |
| Bitmap::GetHistogram |
The Bitmap::GetHistogram method returns one or more histograms for specified color channels of this Bitmap object. |
| Bitmap::GetHistogramSize |
The Bitmap::GetHistogramSize returns the number of elements (in an array of UINTs) that you must allocate before you call the Bitmap::GetHistogram method of a Bitmap object. |
| Bitmap::GetPixel |
The Bitmap::GetPixel method gets the color of a specified pixel in this bitmap. |
| Bitmap::InitializePalette |
The Bitmap::InitializePalette method initializes a standard, optimal, or custom color palette. |
| Bitmap::LockBits |
The Bitmap::LockBits method locks a rectangular portion of this bitmap and provides a temporary buffer that you can use to read or write pixel data in a specified format. Any pixel data that you write to the buffer is copied to the Bitmap object when you call Bitmap::UnlockBits. |
| Bitmap::SetPixel |
The Bitmap::SetPixel method sets the color of a specified pixel in this bitmap. |
| Bitmap::SetResolution |
The Bitmap::SetResolution method sets the resolution of this Bitmap object. |
| Bitmap::UnlockBits |
The Bitmap::UnlockBits method unlocks a portion of this bitmap that was previously locked by a call to Bitmap::LockBits. |
Send comments about this topic to Microsoft
Build date: 3/6/2012