DdCreateDIBSection function (ddrawgdi.h)

[This function is subject to change with each operating system revision. Instead, use the Microsoft DirectDraw and Microsoft Direct3DAPIs; these APIs insulate applications from such operating system changes, and hide many other difficulties involved in interacting directly with display drivers.]

Creates a DIBSECTION structure that shares its color table with the device.

GdiEntry9 is defined as an alias for this function.

Syntax

HBITMAP DdCreateDIBSection(
  HDC              hdc,
  const BITMAPINFO *pbmi,
  UINT             iUsage,
  VOID             **ppvBits,
  HANDLE           hSectionApp,
  DWORD            dwOffset
);

Parameters

hdc

A valid DC compatible with the current display device.

pbmi

Pointer to a BITMAPINFO structure that describes the requested DIBSECTION.

iUsage

Specifies the type of data contained in the bmiColors array member of the BITMAPINFO structure pointed to by pbmi (either logical palette indexes or literal RGB values). The following values are defined.

(DIB_PAL_COLORS)

The bmiColors member is an array of 16-bit indexes into the logical palette of the device context specified by hdc.

(DIB_RGB_COLORS)

The BITMAPINFO structure contains an array of literal RGB values.

ppvBits

Pointer to a pointer to the created DIBSECTION data.

hSectionApp

Reserved. Must be NULL.

dwOffset

Return value

If successful, this function returns a handle to a bitmap representing the DIBSECTION; otherwise it returns NULL.

Remarks

Calling this function ensures an identity palette, and no palette conversion when IDirectDrawSurface7::Blt or StretchBlt are called.

Applications are advised to use IDirectDrawSurface7, which can create 8-bit-per-pixel, identity-paletted surfaces in a manner independent of the operating system.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ddrawgdi.h

See also

Graphics Low Level Client Support