bmcicolors table. if the bit is set, the pixel has the color of the second entry in the table.
4 the bitmap has a maximum of 16 colors, and the bmcicolors member contains 16 entries. each pixel in the bitmap is represented by a four-bit index into the color table.
for example, if the first byte in the bitmap is 0x1f, the byte represents
two pixels. the first pixel contains the color in the second table entry, and
the second pixel contains the color in the sixteenth table entry.
8 the bitmap has a maximum of 256 colors, and the bmcicolors member contains 256 entries. in this case, each byte in the array represents a single pixel.
24 the bitmap has a maximum of 2^24 colors. the bmcicolors member is null, and each 3-byte sequence in the bitmap array represents the relative intensities of red, green, and blue, respectively, of a pixel.
the colors in the bmcicolors table should appear in order of importance. alternatively, for functions that use dibs, the bmcicolors member can be an array of 16-bit unsigned integers that specify an index into the currently realized logical palette instead of explicit rgb values. in this case, an application using the bitmap must call dib functions with the wusage parameter set to dib_pal_colors.
note: the bmcicolors member should not contain palette indexes if the bitmap is to be stored in a file or transferred to another application. unless the application uses the bitmap exclusively and under its complete control, the bitmap color table should contain explicit rgb values.
see also
bitmapinfo, bitmapcoreheader, rgbtriple
============================================================================
== bitmapcoreheader (3.0)
typedef struct tagbitmapcoreheader { /* bmch */ dword bcsize; short bcwidth; short bcheight; word bcplanes; word bcbitcount; } bitmapcoreheader;
the bitmapcoreheader structure contains information about the dimensions and color format of a device-independent bitmap (dib). windows applications should use the bitmapinfoheader structure instead of bitmapcoreheader whenever possible.
member description
bcsize specifies the number of bytes required by the bitmapcoreheader structure.
bcwidth specifies the width of the bitmap, in pixels. bcheightspecifies the height of the bitmap, in pixels.
bcplanesspecifies the number of planes for the target device. this member must be set to 1.
bcbitcount specifies the number of bits per pixel. this value must be 1, 4, 8, or 24.
comments
the bitmapcoreinfo structure combines the bitmapcoreheader structure and a color table to provide a complete definition of the dimensions and colors of a dib. see the description of the bitmapcoreinfo structure for more information about specifying a dib.
an application should use the information stored in the bcsize member to locate the color table in a bitmapcoreinfo structure with a method such as the following:
lpcolor = ((lpstr) pbitmapcoreinfo + (uint) (pbitmapcoreinfo->bcsize))
see also
bitmapcoreinfo, bitmapinfoheader, bitmapinfoheader 上一篇:bmp format(bmp文件格式) 下一篇:数据安全的注意事项 |