Bitmap::Bitmap method

Creates a Bitmap::Bitmap object based on a handle to a Windows Windows Graphics Device Interface (GDI) bitmap and a handle to a GDI palette.

Syntax

void Bitmap(
  IN HBITMAP  hbm,
  IN HPALETTE hpal
);

Parameters

hbm

Type: HBITMAP

Handle to a GDI bitmap.

hpal

Type: HPALETTE

Handle to a GDI palette used to define the bitmap colors if hbm is not a device-independent bitmap (DIB).

Return Value

None

Remarks

You are responsible for deleting the GDI bitmap and the GDI palette. However, you should not delete the GDI bitmap or the GDI palette until after the GDI+ Bitmap::Bitmap object is deleted or goes out of scope.

Do not pass to the GDI+ Bitmap::Bitmap constructor a GDI bitmap or a GDI palette that is currently (or was previously) selected into a device context.

Requirements

   
Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header gdiplusheaders.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

See Also

Bitmap

Bitmap Constructors

Bitmap::FromHBITMAP

Image

Images, Bitmaps, and Metafiles

Using Images, Bitmaps, and Metafiles