Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
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 CreateCompatibleDCfunction 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 LoadBitmapor the LoadImagefunction to load a bitmap.

  3. Select the bitmap into the DC by calling the SelectObjectfunction. 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::GetDCmethod to get the target DC.

  2. Call the BitBltfunction 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