Share via


Using Bitmaps

Send Feedback

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 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 CE automatically translates source pixels to the nearest matching color that can be represented in the target format.

See Also

Working with DirectDraw Surfaces

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.