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(
  HDC hdc,
  int cx,
  int cy
);

Parameters

hdc

A handle to a device context.

cx

The width, in pixels, of the bitmap.

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

   
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