bisize specifies the number of bytes required by the
bitmapinfoheader structure.
biwidth specifies the width of the bitmap, in pixels.
biheightspecifies the height of the bitmap, in pixels.
biplanesspecifies the number of planes for the target device. this
member must be set to 1.
bibitcount specifies the number of bits per pixel. this value must be 1,
4, 8, or 24.
bicompression specifies the type of compression for a compressed bitmap. it
can be one of the following values:
value meaning
bi_rgb specifies that the bitmap is not compressed.
bi_rle8 specifies a run-length encoded format for bitmaps with 8 bits
per pixel. the compression format is a 2-byte format consisting of a count
byte followed by a byte containing a color index. for more information, see
the following comments section.
bi_rle4 specifies a run-length encoded format for bitmaps with 4 bits
per pixel. the compression format is a 2-byte format consisting of a count
byte followed by two word-length color indexes. for more information, see
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:
value meaning
0 end of line.
1 end of bitmap.
2 delta. the two bytes following the escape contain unsigned values
indicating the horizontal and vertical offset of the next pixel from the
current position.
absolute mode is signaled by the first byte set to zero and the second byte
set to a value between 0x03 and 0xff. in absolute mode, the second byte
represents the number of bytes that follow, each of which contains the color
index of a single pixel. when the second byte is set to 2 or less, the escape
has the same meaning as in encoded mode. in absolute mode, each run must be
aligned on a word boundary. the following example shows the hexadecimal
values of an 8-bit compressed bitmap:
03 04 05 06 00 03 45 56 67 00 02 78 00 02 05 01
02 78 00 00 09 1e 00 01
this bitmap would expand as follows (two-digit values represent a color index
for a single pixel):
04 04 04
06 06 06 06 06
45 56 67
78 78
move current position 5 right and 1 down
78 78
end of line
1e 1e 1e 1e 1e 1e 1e 1e 1e
end of rle bitmap
bi_rle4
when the bicompression member is set to bi_rle4, the bitmap is compressed
using a run-length encoding (rle) format for a 4-bit bitmap, which also uses
encoded and absolute modes. in encoded mode, the first byte of the pair
contains the number of pixels to be drawn using the color indexes in the
second byte. the second byte contains two color indexes, one in its
high-order nibble (that is, its low-order four bits) and one in its low-order
nibble. the first of the pixels is drawn using the color specified by the
high-order nibble, the second is drawn using the color in the low-order
nibble, the third is drawn with the color in the high-order nibble, and so
on, until all the pixels specified by the first byte have been drawn. in
absolute mode, the first byte contains zero, the second byte contains the
number of color indexes that follow, and subsequent bytes contain color
indexes in their high- and low-order nibbles, one color index for each pixel.
in absolute mode, each run must be aligned on a word boundary. the
end-of-line, end-of-bitmap, and delta escapes also apply to bi_rle4.
the following example shows the hexadecimal values of a 4-bit compressed
bitmap:
03 04 05 06 00 06 45 56 67 00 04 78 00 02 05 01
04 78 00 00 09 1e 00 01
this bitmap would expand as follows (single-digit values represent a color
index for a single pixel):
2 个解决方案
#1
0 4 0
0 6 0 6 0
4 5 5 6 6 7
7 8 7 8
move current position 5 right and 1 down
7 8 7 8
end of line
1 e 1 e 1 e 1 e 1
end of rle bitmap
see also
bitmapinfo
==============================================================================
rgbquad (3.0)
typedef struct tagrgbquad { /* rgbq */
byte rgbblue;
byte rgbgreen;
byte rgbred;
byte rgbreserved;
} rgbquad;
the rgbquad structure describes a color consisting of relative intensities of
red, green, and blue. the bmicolors member of the bitmapinfo structure
consists of an array of rgbquad structures.
member description
rgbblue specifies the intensity of blue in the color.
rgbgreenspecifies the intensity of green in the color.
rgbred specifies the intensity of red in the color.
rgbreserved not used; must be set to zero.
see also
bitmapinfo
==============================================================================
rgb (2.x)
colorref rgb(cred, cgreen, cblue)
byte cred; /* red component of color */
byte cgreen; /* green component of color */
byte cblue; /* blue component of color */
the rgb macro selects an rgb color based on the parameters supplied and the
color capabilities of the output device.
parameter description
cred specifies the intensity of the red color field.
cgreen specifies the intensity of the green color field.
cblue specifies the intensity of the blue color field.
returns
the return value specifies the resultant rgb color.
comments
the intensity for each argument can range from 0 through 255. if all three
intensities are specified as zero, the result is black. if all three
intensities are specified as 255, the result is white.
comments
the rgb macro is defined in windows.h as follows:
#define rgb(r,g,b) ((colorref)(((byte)(r)|((word)(g)<<8))| \
(((dword)(byte)(b))<<16)))
see also
getbvalue, getgvalue, getrvalue, paletteindex, palettergb
==============================================================================
bitmapcoreinfo (3.0)
typedef struct tagbitmapcoreinfo { /* bmci */
bitmapcoreheader bmciheader;
rgbtriple bmcicolors[1];
} bitmapcoreinfo;
the bitmapcoreinfo structure fully defines the dimensions and color
information for a device-independent bitmap (dib). windows applications
should use the bitmapinfo structure instead of bitmapcoreinfo whenever
possible.
member description
bmciheader specifies a bitmapcoreheader structure that contains
information about the dimensions and color format of a dib.
bmcicolors specifies an array of rgbtriple structures that define the
colors in the bitmap.
comments
the bitmapcoreinfo structure describes the dimensions and colors of a bitmap.
it is followed immediately in memory by an array of bytes which define the
pixels of the bitmap. the bits in the array are packed together, but each
scan line must be zero-padded to end on a long boundary. segment boundaries,
however, can appear anywhere in the bitmap. the origin of the bitmap is the
lower-left corner.
the bcbitcount member of the bitmapcoreheader structure determines the number
of bits that define each pixel and the maximum number of colors in the
bitmap. this member may be set to any of the following values:
value meaning
1 the bitmap is monochrome, and the bmcicolors member must contain two
entries. each bit in the bitmap array represents a pixel. if the bit is
clear, the pixel is displayed with the color of the first entry in the
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
=============================================================================
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
structure consists of an array of rgbtriple structures. windows applications
should use the bitmapinfo structure instead of bitmapcoreinfo whenever
possible. the bitmapinfo structure uses an rgbquad structure instead of the
rgbtriple structure.
member description
rgbtbluespecifies the intensity of blue in the color.
rgbtgreen specifies the intensity of green in the color.
rgbtred specifies the intensity of red in the color.
see also
bitmapcoreinfo, bitmapinfo, rgbquad
0 6 0 6 0
4 5 5 6 6 7
7 8 7 8
move current position 5 right and 1 down
7 8 7 8
end of line
1 e 1 e 1 e 1 e 1
end of rle bitmap
see also
bitmapinfo
==============================================================================
rgbquad (3.0)
typedef struct tagrgbquad { /* rgbq */
byte rgbblue;
byte rgbgreen;
byte rgbred;
byte rgbreserved;
} rgbquad;
the rgbquad structure describes a color consisting of relative intensities of
red, green, and blue. the bmicolors member of the bitmapinfo structure
consists of an array of rgbquad structures.
member description
rgbblue specifies the intensity of blue in the color.
rgbgreenspecifies the intensity of green in the color.
rgbred specifies the intensity of red in the color.
rgbreserved not used; must be set to zero.
see also
bitmapinfo
==============================================================================
rgb (2.x)
colorref rgb(cred, cgreen, cblue)
byte cred; /* red component of color */
byte cgreen; /* green component of color */
byte cblue; /* blue component of color */
the rgb macro selects an rgb color based on the parameters supplied and the
color capabilities of the output device.
parameter description
cred specifies the intensity of the red color field.
cgreen specifies the intensity of the green color field.
cblue specifies the intensity of the blue color field.
returns
the return value specifies the resultant rgb color.
comments
the intensity for each argument can range from 0 through 255. if all three
intensities are specified as zero, the result is black. if all three
intensities are specified as 255, the result is white.
comments
the rgb macro is defined in windows.h as follows:
#define rgb(r,g,b) ((colorref)(((byte)(r)|((word)(g)<<8))| \
(((dword)(byte)(b))<<16)))
see also
getbvalue, getgvalue, getrvalue, paletteindex, palettergb
==============================================================================
bitmapcoreinfo (3.0)
typedef struct tagbitmapcoreinfo { /* bmci */
bitmapcoreheader bmciheader;
rgbtriple bmcicolors[1];
} bitmapcoreinfo;
the bitmapcoreinfo structure fully defines the dimensions and color
information for a device-independent bitmap (dib). windows applications
should use the bitmapinfo structure instead of bitmapcoreinfo whenever
possible.
member description
bmciheader specifies a bitmapcoreheader structure that contains
information about the dimensions and color format of a dib.
bmcicolors specifies an array of rgbtriple structures that define the
colors in the bitmap.
comments
the bitmapcoreinfo structure describes the dimensions and colors of a bitmap.
it is followed immediately in memory by an array of bytes which define the
pixels of the bitmap. the bits in the array are packed together, but each
scan line must be zero-padded to end on a long boundary. segment boundaries,
however, can appear anywhere in the bitmap. the origin of the bitmap is the
lower-left corner.
the bcbitcount member of the bitmapcoreheader structure determines the number
of bits that define each pixel and the maximum number of colors in the
bitmap. this member may be set to any of the following values:
value meaning
1 the bitmap is monochrome, and the bmcicolors member must contain two
entries. each bit in the bitmap array represents a pixel. if the bit is
clear, the pixel is displayed with the color of the first entry in the
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
=============================================================================
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
structure consists of an array of rgbtriple structures. windows applications
should use the bitmapinfo structure instead of bitmapcoreinfo whenever
possible. the bitmapinfo structure uses an rgbquad structure instead of the
rgbtriple structure.
member description
rgbtbluespecifies the intensity of blue in the color.
rgbtgreen specifies the intensity of green in the color.
rgbtred specifies the intensity of red in the color.
see also
bitmapcoreinfo, bitmapinfo, rgbquad
#2
谨以此
献给那些热爱图像编程的朋友却也看不懂E文的人。
献给那些热爱图像编程的朋友却也看不懂E文的人。
#1
0 4 0
0 6 0 6 0
4 5 5 6 6 7
7 8 7 8
move current position 5 right and 1 down
7 8 7 8
end of line
1 e 1 e 1 e 1 e 1
end of rle bitmap
see also
bitmapinfo
==============================================================================
rgbquad (3.0)
typedef struct tagrgbquad { /* rgbq */
byte rgbblue;
byte rgbgreen;
byte rgbred;
byte rgbreserved;
} rgbquad;
the rgbquad structure describes a color consisting of relative intensities of
red, green, and blue. the bmicolors member of the bitmapinfo structure
consists of an array of rgbquad structures.
member description
rgbblue specifies the intensity of blue in the color.
rgbgreenspecifies the intensity of green in the color.
rgbred specifies the intensity of red in the color.
rgbreserved not used; must be set to zero.
see also
bitmapinfo
==============================================================================
rgb (2.x)
colorref rgb(cred, cgreen, cblue)
byte cred; /* red component of color */
byte cgreen; /* green component of color */
byte cblue; /* blue component of color */
the rgb macro selects an rgb color based on the parameters supplied and the
color capabilities of the output device.
parameter description
cred specifies the intensity of the red color field.
cgreen specifies the intensity of the green color field.
cblue specifies the intensity of the blue color field.
returns
the return value specifies the resultant rgb color.
comments
the intensity for each argument can range from 0 through 255. if all three
intensities are specified as zero, the result is black. if all three
intensities are specified as 255, the result is white.
comments
the rgb macro is defined in windows.h as follows:
#define rgb(r,g,b) ((colorref)(((byte)(r)|((word)(g)<<8))| \
(((dword)(byte)(b))<<16)))
see also
getbvalue, getgvalue, getrvalue, paletteindex, palettergb
==============================================================================
bitmapcoreinfo (3.0)
typedef struct tagbitmapcoreinfo { /* bmci */
bitmapcoreheader bmciheader;
rgbtriple bmcicolors[1];
} bitmapcoreinfo;
the bitmapcoreinfo structure fully defines the dimensions and color
information for a device-independent bitmap (dib). windows applications
should use the bitmapinfo structure instead of bitmapcoreinfo whenever
possible.
member description
bmciheader specifies a bitmapcoreheader structure that contains
information about the dimensions and color format of a dib.
bmcicolors specifies an array of rgbtriple structures that define the
colors in the bitmap.
comments
the bitmapcoreinfo structure describes the dimensions and colors of a bitmap.
it is followed immediately in memory by an array of bytes which define the
pixels of the bitmap. the bits in the array are packed together, but each
scan line must be zero-padded to end on a long boundary. segment boundaries,
however, can appear anywhere in the bitmap. the origin of the bitmap is the
lower-left corner.
the bcbitcount member of the bitmapcoreheader structure determines the number
of bits that define each pixel and the maximum number of colors in the
bitmap. this member may be set to any of the following values:
value meaning
1 the bitmap is monochrome, and the bmcicolors member must contain two
entries. each bit in the bitmap array represents a pixel. if the bit is
clear, the pixel is displayed with the color of the first entry in the
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
=============================================================================
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
structure consists of an array of rgbtriple structures. windows applications
should use the bitmapinfo structure instead of bitmapcoreinfo whenever
possible. the bitmapinfo structure uses an rgbquad structure instead of the
rgbtriple structure.
member description
rgbtbluespecifies the intensity of blue in the color.
rgbtgreen specifies the intensity of green in the color.
rgbtred specifies the intensity of red in the color.
see also
bitmapcoreinfo, bitmapinfo, rgbquad
0 6 0 6 0
4 5 5 6 6 7
7 8 7 8
move current position 5 right and 1 down
7 8 7 8
end of line
1 e 1 e 1 e 1 e 1
end of rle bitmap
see also
bitmapinfo
==============================================================================
rgbquad (3.0)
typedef struct tagrgbquad { /* rgbq */
byte rgbblue;
byte rgbgreen;
byte rgbred;
byte rgbreserved;
} rgbquad;
the rgbquad structure describes a color consisting of relative intensities of
red, green, and blue. the bmicolors member of the bitmapinfo structure
consists of an array of rgbquad structures.
member description
rgbblue specifies the intensity of blue in the color.
rgbgreenspecifies the intensity of green in the color.
rgbred specifies the intensity of red in the color.
rgbreserved not used; must be set to zero.
see also
bitmapinfo
==============================================================================
rgb (2.x)
colorref rgb(cred, cgreen, cblue)
byte cred; /* red component of color */
byte cgreen; /* green component of color */
byte cblue; /* blue component of color */
the rgb macro selects an rgb color based on the parameters supplied and the
color capabilities of the output device.
parameter description
cred specifies the intensity of the red color field.
cgreen specifies the intensity of the green color field.
cblue specifies the intensity of the blue color field.
returns
the return value specifies the resultant rgb color.
comments
the intensity for each argument can range from 0 through 255. if all three
intensities are specified as zero, the result is black. if all three
intensities are specified as 255, the result is white.
comments
the rgb macro is defined in windows.h as follows:
#define rgb(r,g,b) ((colorref)(((byte)(r)|((word)(g)<<8))| \
(((dword)(byte)(b))<<16)))
see also
getbvalue, getgvalue, getrvalue, paletteindex, palettergb
==============================================================================
bitmapcoreinfo (3.0)
typedef struct tagbitmapcoreinfo { /* bmci */
bitmapcoreheader bmciheader;
rgbtriple bmcicolors[1];
} bitmapcoreinfo;
the bitmapcoreinfo structure fully defines the dimensions and color
information for a device-independent bitmap (dib). windows applications
should use the bitmapinfo structure instead of bitmapcoreinfo whenever
possible.
member description
bmciheader specifies a bitmapcoreheader structure that contains
information about the dimensions and color format of a dib.
bmcicolors specifies an array of rgbtriple structures that define the
colors in the bitmap.
comments
the bitmapcoreinfo structure describes the dimensions and colors of a bitmap.
it is followed immediately in memory by an array of bytes which define the
pixels of the bitmap. the bits in the array are packed together, but each
scan line must be zero-padded to end on a long boundary. segment boundaries,
however, can appear anywhere in the bitmap. the origin of the bitmap is the
lower-left corner.
the bcbitcount member of the bitmapcoreheader structure determines the number
of bits that define each pixel and the maximum number of colors in the
bitmap. this member may be set to any of the following values:
value meaning
1 the bitmap is monochrome, and the bmcicolors member must contain two
entries. each bit in the bitmap array represents a pixel. if the bit is
clear, the pixel is displayed with the color of the first entry in the
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
=============================================================================
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
structure consists of an array of rgbtriple structures. windows applications
should use the bitmapinfo structure instead of bitmapcoreinfo whenever
possible. the bitmapinfo structure uses an rgbquad structure instead of the
rgbtriple structure.
member description
rgbtbluespecifies the intensity of blue in the color.
rgbtgreen specifies the intensity of green in the color.
rgbtred specifies the intensity of red in the color.
see also
bitmapcoreinfo, bitmapinfo, rgbquad
#2
谨以此
献给那些热爱图像编程的朋友却也看不懂E文的人。
献给那些热爱图像编程的朋友却也看不懂E文的人。