Share via


Using Bitmaps

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

A bitmap is an array of bits that creates an image when it is mapped to a rectangular pixel array on an output device.

Windows Embedded CE supports device-independent bitmaps (DIBs). A DIB has its own color table and can be displayed on a variety of devices. Most graphics information is stored in DIB format. For more information, see Creating Bitmaps.

To store a DIB in memory

  1. Call the CreateCompatibleDC function to create a memory DC that is compatible with the specified device. The DC contains a read-only single-pixel monochrome bitmap.

  2. Use the LoadBitmap or the LoadImage function to load a bitmap.

  3. Select the bitmap into the DC by calling the SelectObject function. The default bitmap is then replaced with a reference to the loaded bitmap.

To transfer the DIB to a DirectDraw surface

  1. Call the IDirectDrawSurface::GetDC method to get the target DC.

  2. Call the BitBlt function to transfer the color data from the GDI DC to the DirectDraw DC.

    Note

    Because arbitrary formats are supported, you can perform a bit block transfer (blit) between bitmaps with different pixel depths. Windows Embedded CE automatically translates source pixels to the nearest matching color that can be represented in the target format.

See Also

Concepts

Working with DirectDraw Surfaces