2.11 Bitmap Functions

A bitmap is a matrix of memory bits that, when copied to a device, defines the color and pattern of a corresponding matrix of pixels on the display surface of the device. Bitmaps are useful in drawing, charting, and word-processing applications because they prepare images in memory and then quickly copy them to the display.

The relationship between bitmap bits in memory and pixels on a device is device-dependent. On a monochrome device, the correspondence is usually one-to-one, where one bit in memory corresponds to one pixel on the device.

Bitmap functions display bitmaps. Following are the bitmap functions:

Function Description

BitBlt Copies a bitmap from a source to a destination device.
CreateBitmap Creates a bitmap.
CreateBitmapIndirect Creates a bitmap described in a structure.
CreateCompatibleBitmap Creates a bitmap that is compatible with a specified device.
CreateDiscardableBitmap Creates a discardable bitmap that is compatible with a specified device.
ExtFloodFill Fills the display surface within a border or over an area of a given color.
FloodFill Fills the display surface within a border.
GetBitmapBits Retrieves the bits in memory for a specific bitmap.
GetBitmapDimension Retrieves the height and width of a bitmap.
GetBitmapDimensionEx Retrieves the height and width of a bitmap.
GetPixel Retrieves the RGB value for a pixel.
LoadBitmap Loads a bitmap from a resource file.
PatBlt Creates a bit pattern.
SetBitmapBits Sets the bits of a bitmap.
SetBitmapDimension Sets the height and width of a bitmap.
SetBitmapDimensionEx Sets the height and width of a bitmap.
SetPixel Sets the RGB value for a pixel.
StretchBlt Copies a bitmap from a source to a destination device (compressing or stretching the bitmap, if necessary).

In addition, applications can use the LoadBitmap function from the USER API to load a bitmap from a resource file. For more information about this USER function, see Chapter 1, “Window Management.”