CreateDiscardableBitmap function

The CreateDiscardableBitmap function creates a discardable bitmap that is compatible with the specified device. The bitmap has the same bits-per-pixel format and the same color palette as the device. An application can select this bitmap as the current bitmap for a memory device that is compatible with the specified device.

Note  This function is provided only for compatibility with 16-bit versions of Windows. Applications should use the CreateCompatibleBitmap function.
 

Syntax


HBITMAP CreateDiscardableBitmap(
  _In_ HDC hdc,
  _In_ int nWidth,
  _In_ int nHeight
);

Parameters

hdc [in]

A handle to a device context.

nWidth [in]

The width, in pixels, of the bitmap.

nHeight [in]

The height, in pixels, of the bitmap.

Return value

If the function succeeds, the return value is a handle to the compatible bitmap (DDB).

If the function fails, the return value is NULL.

Remarks

When you no longer need the bitmap, call the DeleteObject function to delete it.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Wingdi.h (include Windows.h)

Library

Gdi32.lib

DLL

Gdi32.dll

See also

Bitmaps Overview
Bitmap Functions
CreateCompatibleBitmap
DeleteObject

 

 

Show: