HBITMAP CreateDIBitmap(hDC,lpInfoHeader,dwUsage,lpInitBits,lpInitInfo,wUsage)
This function creates a device-specific memory bitmap from a device-independent bitmap (DIB) specification and optionally sets bits in the bitmap.
Parameter | Type/Description | ||
hDC | HDC Identifies the device context. | ||
lpInfoHeader | LPBITMAPINFOHEADER Points to a BITMAPINFOHEADER structure that describes the size and format of the device-independent bitmap. | ||
dwUsage | DWORD Indicates whether the memory bitmap is to be initialized. If dwUsage is set to CBM_INIT, CreateDIBitmap will initialize the bitmap with the bits specified by lpInitBits and lpInitInfo. | ||
lpInitBits | LPSTR Points to a byte array that contains the initial bitmap values. The format of the bitmap values depends on the biBitCount field of the BITMAPINFO structure identified by lpInitInfo. See the description of the BITMAPINFO data structure in Chapter 7, “Data Types and Structures.” | ||
lpInitInfo | LPBITMAPINFO Points to a BITMAPINFO data structure that describes the dimensions and color format of lpInitBits. | ||
wUsage | WORD Specifies whether the bmiColors[ ] fields of the lpInitInfo data structure contain explicit RGB values or indexes into the currently realized logical palette. The wUsage parameter must be one of the following values: | ||
Value | Meaning | ||
DIB_PAL_COLORS | The color table consists of an array of 16-bit indexes into the currently realized logical palette. | ||
DIB_RGB_COLORS | The color table contains literal RGB values. |
The return value identifies a bitmap if the function is successful. Otherwise, it is NULL.
This function also accepts a device-independent bitmap specification formatted for Microsoft OS/2 Presentation Manager versions 1.1 and 1.2 if the lpInfoHeader points to a BITMAPCOREHEADER data structure and the lpInitInfo parameter points to a BITMAPCOREINFO data structure.