Graphics File Formats(Windows的.BMP .CUR .ICO文件的格式,有范例)
the following comments section.
bisizeimage specifies the size, in bytes, of the image. it is valid to set this member to zero if the bitmap is in the bi_rgb format.
bixpelspermeter specifies the horizontal resolution, in pixels per meter, of the target device for the bitmap. an application can use this value to select a bitmap from a resource group that best matches the characteristics of the current device.
biypelspermeter specifies the vertical resolution, in pixels per meter, of the target device for the bitmap.
biclrused specifies the number of color indexes in the color table actually used by the bitmap. if this value is zero, the bitmap uses the maximum number of colors corresponding to the value of the bibitcount member. for more information on the maximum sizes of the color table, see the description of the bitmapinfo structure earlier in this topic.
if the biclrused member is nonzero, it specifies the actual number of colors that the graphics engine or device driver will access if the bibitcount member is less than 24. if bibitcount is set to 24, biclrused specifies the size of the reference color table used to optimize performance of windows color palettes. if the bitmap is a packed bitmap (that is, a bitmap in which the bitmap array immediately follows the bitmapinfo header and which is referenced by a single pointer), the biclrused member must be set to zero or to the actual size of the color table.
biclrimportant specifies the number of color indexes that are considered important for displaying the bitmap. if this value is zero, all colors are important.
comments
the bitmapinfo structure combines the bitmapinfoheader structure and a color table to provide a complete definition of the dimensions and colors of a windows 3.0 or later dib. for more information about specifying a windows 3.0 dib, see the description of the bitmapinfo structure.
an application should use the information stored in the bisize member to locate the color table in a bitmapinfo structure as follows:
pcolor = ((lpstr) pbitmapinfo + (word) (pbitmapinfo->bmiheader.bisize))
windows supports formats for compressing bitmaps that define their colors with 8 bits per pixel and with 4 bits per pixel. compression reduces the disk and memory storage required for the bitmap. the following paragraphs describe these formats.
bi_rle8
when the bicompression member is set to bi_rle8, the bitmap is compressed using a run-length encoding format for an 8-bit bitmap. this format may be compressed in either of two modes: encoded and absolute. both modes can occur anywhere throughout a single bitmap.
encoded mode consists of two bytes: the first byte specifies the number of consecutive pixels to be drawn using the color index contained in the second byte. in addition, the first byte of the pair can be set to zero to indicate an escape that denotes an end of line, end of bitmap, or a delta. the interpretation of the escape depends on the value of the second byte of the pair. the following list shows the meaning of the second byte: |