Bitmaps

A bitmap is an array of bits that, when mapped to a rectangular pixel array on an output device, creates an image. You use bitmaps to create, modify, and store images.

There are two types of bitmaps, device-dependent bitmaps (DDBs) and device-independent bitmaps (DIBs). A DDB does not have its own color table and can therefore only be properly displayed by a device with the same display memory organization as the one on which it was created. A DIB, on the other hand, generally has its own color table, and can therefore be displayed on a variety of devices.

Virtually all graphical information in Windows CE is stored in DIB format. Windows CE supports DDBs only to remain compatible with applications written for early versions of Windows. You should use DIBs in all applications you write for, or port to, Windows CE.

The BITMAP structure contains all of the height, width, and color data needed to draw a DDB. The data needed to draw a DIB is stored in a BITMAPINFO structure which consists of a BITMAPINFOHEADER structure and two or more RGBQUAD structures. The BITMAPINFOHEADER structure contains information about the dimensions and color format of a DIB. Each RGBQUAD structure defines one of the bitmap's colors.

Windows CE supports bitmaps with pixel depths of 1, 2, 4, 8, 16, 24, and 32 bits per pixel (bpp). For more information on colors in Windows CE, see Designing the User Interface for Windows CE.

Windows CE does not support compressed bitmap formats, such as run-length encoded bitmaps.