CreateDiscardableBitmap function (wingdi.h)

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 cx,
  [in] int cy
);

Parameters

[in] hdc

A handle to a device context.

[in] cx

The width, in pixels, of the bitmap.

[in] cy

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

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wingdi.h (include Windows.h)
Library Gdi32.lib
DLL Gdi32.dll

See also

Bitmap Functions

Bitmaps Overview

CreateCompatibleBitmap

DeleteObject