📄 bmp.htm
字号:
indexes in their high- and low-order nibbles, one color index for each pixel.<br>
in absolute mode, each run must be aligned on a word boundary. the<br>
end-of-line, end-of-bitmap, and delta escapes also apply to bi_rle4.<br>
<br>
the following example shows the hexadecimal values of a 4-bit compressed<br>
bitmap:<br>
<br>
<br>
<br>
03 04 05 06 00 06 45 56 67 00 04 78 00 02 05 01<br>
04 78 00 00 09 1e 00 01<br>
<br>
this bitmap would expand as follows (single-digit values represent a color<br>
index for a single pixel):<br>
<br>
<br>
<br>
0 4 0<br>
0 6 0 6 0<br>
4 5 5 6 6 7<br>
7 8 7 8<br>
move current position 5 right and 1 down<br>
7 8 7 8<br>
end of line<br>
1 e 1 e 1 e 1 e 1<br>
end of rle bitmap<br>
<br>
see also<br>
<br>
bitmapinfo <br>
<br>
==============================================================================<br>
rgbquad (3.0)<br>
<br>
<br>
<br>
typedef struct tagrgbquad { /* rgbq */<br>
byte rgbblue;<br>
byte rgbgreen;<br>
byte rgbred;<br>
byte rgbreserved;<br>
} rgbquad;<br>
<br>
the rgbquad structure describes a color consisting of relative intensities of<br>
red, green, and blue. the bmicolors member of the bitmapinfo structure<br>
consists of an array of rgbquad structures.<br>
<br>
member description<br>
<br>
rgbblue specifies the intensity of blue in the color. <br>
rgbgreenspecifies the intensity of green in the color. <br>
rgbred specifies the intensity of red in the color. <br>
rgbreserved not used; must be set to zero. <br>
<br>
see also<br>
<br>
bitmapinfo <br>
<br>
==============================================================================<br>
rgb (2.x)<br>
<br>
colorref rgb(cred, cgreen, cblue)<br>
<br>
byte cred; /* red component of color */<br>
byte cgreen; /* green component of color */<br>
byte cblue; /* blue component of color */<br>
<br>
<br>
the rgb macro selects an rgb color based on the parameters supplied and the<br>
color capabilities of the output device.<br>
<br>
parameter description<br>
<br>
cred specifies the intensity of the red color field. <br>
cgreen specifies the intensity of the green color field. <br>
cblue specifies the intensity of the blue color field. <br>
<br>
returns<br>
<br>
the return value specifies the resultant rgb color. <br>
<br>
comments<br>
<br>
the intensity for each argument can range from 0 through 255. if all three<br>
intensities are specified as zero, the result is black. if all three<br>
intensities are specified as 255, the result is white.<br>
<br>
comments<br>
<br>
the rgb macro is defined in windows.h as follows: <br>
<br>
<br>
<br>
#define rgb(r,g,b) ((colorref)(((byte)(r)|((word)(g)<<8))| \<br>
(((dword)(byte)(b))<<16)))<br>
<br>
see also<br>
<br>
getbvalue, getgvalue, getrvalue, paletteindex, palettergb<br>
<br>
==============================================================================<br>
bitmapcoreinfo (3.0)<br>
<br>
<br>
<br>
typedef struct tagbitmapcoreinfo { /* bmci */<br>
bitmapcoreheader bmciheader;<br>
rgbtriple bmcicolors[1];<br>
} bitmapcoreinfo;<br>
<br>
the bitmapcoreinfo structure fully defines the dimensions and color<br>
information for a device-independent bitmap (dib). windows applications<br>
should use the bitmapinfo structure instead of bitmapcoreinfo whenever<br>
possible.<br>
<br>
member description<br>
<br>
bmciheader specifies a bitmapcoreheader structure that contains<br>
information about the dimensions and color format of a dib.<br>
<br>
bmcicolors specifies an array of rgbtriple structures that define the<br>
colors in the bitmap.<br>
<br>
comments<br>
<br>
the bitmapcoreinfo structure describes the dimensions and colors of a bitmap.<br>
it is followed immediately in memory by an array of bytes which define the<br>
pixels of the bitmap. the bits in the array are packed together, but each<br>
scan line must be zero-padded to end on a long boundary. segment boundaries,<br>
however, can appear anywhere in the bitmap. the origin of the bitmap is the<br>
lower-left corner.<br>
<br>
the bcbitcount member of the bitmapcoreheader structure determines the number<br>
of bits that define each pixel and the maximum number of colors in the<br>
bitmap. this member may be set to any of the following values:<br>
<br>
value meaning<br>
<br>
1 the bitmap is monochrome, and the bmcicolors member must contain two<br>
entries. each bit in the bitmap array represents a pixel. if the bit is<br>
clear, the pixel is displayed with the color of the first entry in the<br>
bmcicolors table. if the bit is set, the pixel has the color of the second<br>
entry in the table.<br>
<br>
4 the bitmap has a maximum of 16 colors, and the bmcicolors member<br>
contains 16 entries. each pixel in the bitmap is represented by a four-bit<br>
index into the color table.<br>
<br>
for example, if the first byte in the bitmap is 0x1f, the byte represents two<br>
pixels. the first pixel contains the color in the second table entry, and the<br>
second pixel contains the color in the sixteenth table entry.<br>
<br>
8 the bitmap has a maximum of 256 colors, and the bmcicolors member<br>
contains 256 entries. in this case, each byte in the array represents a<br>
single pixel.<br>
<br>
24 the bitmap has a maximum of 2^24 colors. the bmcicolors member is<br>
null, and each 3-byte sequence in the bitmap array represents the relative<br>
intensities of red, green, and blue, respectively, of a pixel.<br>
<br>
the colors in the bmcicolors table should appear in order of importance.<br>
alternatively, for functions that use dibs, the bmcicolors member can be an<br>
array of 16-bit unsigned integers that specify an index into the currently<br>
realized logical palette instead of explicit rgb values. in this case, an<br>
application using the bitmap must call dib functions with the wusage<br>
parameter set to dib_pal_colors.<br>
<br>
note: the bmcicolors member should not contain palette indexes if the<br>
bitmap is to be stored in a file or transferred to another application.<br>
unless the application uses the bitmap exclusively and under its complete<br>
control, the bitmap color table should contain explicit rgb values.<br>
<br>
see also<br>
<br>
bitmapinfo, bitmapcoreheader, rgbtriple <br>
<br>
<br>
==============================================================================<br>
bitmapcoreheader (3.0)<br>
<br>
<br>
<br>
typedef struct tagbitmapcoreheader { /* bmch */<br>
dword bcsize;<br>
short bcwidth;<br>
short bcheight;<br>
word bcplanes;<br>
word bcbitcount;<br>
} bitmapcoreheader;<br>
<br>
the bitmapcoreheader structure contains information about the dimensions and<br>
color format of a device-independent bitmap (dib). windows applications<br>
should use the bitmapinfoheader structure instead of bitmapcoreheader<br>
whenever possible.<br>
<br>
member description<br>
<br>
bcsize specifies the number of bytes required by the<br>
bitmapcoreheader structure.<br>
<br>
bcwidth specifies the width of the bitmap, in pixels. <br>
bcheightspecifies the height of the bitmap, in pixels. <br>
<br>
bcplanesspecifies the number of planes for the target device. this<br>
member must be set to 1.<br>
<br>
bcbitcount specifies the number of bits per pixel. this value must be 1,<br>
4, 8, or 24.<br>
<br>
comments<br>
<br>
the bitmapcoreinfo structure combines the bitmapcoreheader structure and a<br>
color table to provide a complete definition of the dimensions and colors of<br>
a dib. see the description of the bitmapcoreinfo structure for more<br>
information about specifying a dib.<br>
<br>
an application should use the information stored in the bcsize member to<br>
locate the color table in a bitmapcoreinfo structure with a method such as<br>
the following:<br>
<br>
<br>
<br>
lpcolor = ((lpstr) pbitmapcoreinfo + (uint) (pbitmapcoreinfo->bcsize))<br>
<br>
see also<br>
<br>
bitmapcoreinfo, bitmapinfoheader, bitmapinfoheader <br>
<br>
=============================================================================<br>
rgbtriple (3.0)<br>
<br>
<br>
<br>
typedef struct tagrgbtriple { /* rgbt */<br>
byte rgbtblue;<br>
byte rgbtgreen;<br>
byte rgbtred;<br>
} rgbtriple;<br>
<br>
the rgbtriple structure describes a color consisting of relative intensities<br>
of red, green, and blue. the bmcicolors member of the bitmapcoreinfo<br>
structure consists of an array of rgbtriple structures. windows applications<br>
should use the bitmapinfo structure instead of bitmapcoreinfo whenever<br>
possible. the bitmapinfo structure uses an rgbquad structure instead of the<br>
rgbtriple structure.<br>
<br>
member description<br>
<br>
rgbtbluespecifies the intensity of blue in the color. <br>
rgbtgreen specifies the intensity of green in the color. <br>
rgbtred specifies the intensity of red in the color.<br>
<br>
see also<br>
<br>
bitmapcoreinfo, bitmapinfo, rgbquad</td>
</tr>
</table>
</center></div>
<p align="center"><a href="../index.htm">返回</a></p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -