Graphics File Formats(Windows的.BMP .CUR .ICO文件的格式,有范例)
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
============================================================================= rgbtriple (3.0)
typedef struct tagrgbtriple { /* rgbt */ byte rgbtblue; byte rgbtgreen; byte rgbtred; } rgbtriple;
the rgbtriple structure describes a color consisting of relative intensities of red, green, and blue. the bmcicolors member of the bitmapcoreinfo |