다음을 통해 공유


BITMAP

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This structure defines the type, width, height, color format, and bit values of a bitmap.

Syntax

typedef struct tagBITMAP {
  LONG bmType; 
  LONG bmWidth; 
  LONG bmHeight; 
  LONG bmWidthBytes; 
  WORD bmPlanes; 
  WORD bmBitsPixel; 
  LPVOID bmBits; 
} BITMAP; 

Members

  • bmType
    Specifies the bitmap type; set to zero
  • bmWidth
    Specifies the width, in pixels, of the bitmap.

    The width must be greater than zero.

  • bmHeight
    Specifies the height, in pixels, of the bitmap.

    The height must be greater than zero.

  • bmWidthBytes
    Specifies the number of bytes in each scan line.

    This value must be divisible by 2, because the system assumes that the bit values of a bitmap form an array that is word aligned.

  • bmPlanes
    Specifies the count of color planes.
  • bmBitsPixel
    Specifies the number of bits required to indicate the color of a pixel.
  • bmBits
    Pointer to the location of the bit values for the bitmap.

    The bmBits member must be a long pointer to an array of character (1-byte) values.

Remarks

The bitmap formats currently used are monochrome and color. The monochrome bitmap uses a one-bit, one-plane format. Each scan is a multiple of 32 bits.

Scans are organized as follows for a monochrome bitmap of height n.

Scan 0 
Scan 1 
. 
. 
. 
Scan n-2 
Scan n-1 

The pixels on a monochrome device are either black or white.

If the corresponding bit in the bitmap is 1, the pixel is set to the foreground color.

If the corresponding bit in the bitmap is zero, the pixel is set to the background color.

All devices that have the RC_BITBLT device capability support bitmaps. For more information, see GetDeviceCaps.

Each device has a unique color format.

Requirements

Header windows.h
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

GetDeviceCaps
GetObject
GDI Structures