create_bitmap


handle create_bitmap(int Width,
                     int height,
                     unsigned planes,
                     unsigned bits,
                     const void* data)

This function creates a bitmap of the given dimensions, color planes and bits/pixel.

Parameters

int Width

The width (in pixels) of the bitmap. If zero is specified, a bitmap of dimensions 1x1 pixel is created.

int height

The height (in pixels) of the bitmap. If zero is specified, a bitmap of dimensions 1x1 pixel is created.

unsigned planes

The number of color planes supported by the device.

unsigned bits

The number of bits used to represent a single pixel.

const void* data

A pointer to the bitmap's color data. If this parameter is zero, the bitmap is created in an uninitialized state.

Return

handle

The handle of the bitmap or null if an error occurred.

Notes

For performance reasons, this function should only be used to create monochromatic bitmaps. color bitmaps should be created through create_compatible_bitmap (which takes the device context color format into account).

The function delete_object may be used to destroy the bitmap when it is no longer required.