Struct BitmapInfoHeader
Namespace: Dapplo.Windows.Gdi32.Structs
Assembly: Dapplo.Windows.Gdi32.dll
Syntax
public struct BitmapInfoHeader
Properties
| Improve this Doc View SourceAlphaMask
Color mask that specifies the alpha component of each pixel.
Declaration
public uint AlphaMask { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
BitCount
The number of bits that define each pixel and the maximum number of colors in the bitmap. This member can be one of the following values: 0 The number of bits per pixel is specified or is implied by the JPEG or PNG file format. 1 The bitmap is monochrome, and the bmiColors member of BITMAPINFO contains 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 bmiColors color 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 bmiColors member of BITMAPINFO contains up to 16 entries. Each pixel in the bitmap is represented by a 4-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 bmiColors member of BITMAPINFO contains up to 256 entries. In this case, each byte in the array represents a single pixel. 16 The bitmap has a maximum of 2^16 colors. If the bV5Compression member of the BITMAPV5HEADER structure is BI_RGB, the bmiColors member of BITMAPINFO is NULL. Each WORD in the bitmap array represents a single pixel. The relative intensities of red, green, and blue are represented with five bits for each color component. The value for blue is in the least significant five bits, followed by five bits each for green and red. The most significant bit is not used. The bmiColors color table is used for optimizing colors used on palette-based devices, and must contain the number of entries specified by the bV5ClrUsed member of the BITMAPV5HEADER. If the bV5Compression member of the BITMAPV5HEADER is BI_BITFIELDS, the bmiColors member contains three DWORD color masks that specify the red, green, and blue components, respectively, of each pixel. Each WORD in the bitmap array represents a single pixel. When the bV5Compression member is BI_BITFIELDS, bits set in each DWORD mask must be contiguous and should not overlap the bits of another mask. All the bits in the pixel do not need to be used. 24 The bitmap has a maximum of 2^24 colors, and the bmiColors member of BITMAPINFO is NULL. Each 3-byte triplet in the bitmap array represents the relative intensities of blue, green, and red, respectively, for a pixel. The bmiColors color table is used for optimizing colors used on palette-based devices, and must contain the number of entries specified by the bV5ClrUsed member of the BITMAPV5HEADER structure. 32 The bitmap has a maximum of 2^32 colors. If the bV5Compression member of the BITMAPV5HEADER is BI_RGB, the bmiColors member of BITMAPINFO is NULL. Each DWORD in the bitmap array represents the relative intensities of blue, green, and red for a pixel. The value for blue is in the least significant 8 bits, followed by 8 bits each for green and red. The high byte in each DWORD is not used. The bmiColors color table is used for optimizing colors used on palette-based devices, and must contain the number of entries specified by the bV5ClrUsed member of the BITMAPV5HEADER. If the bV5Compression member of the BITMAPV5HEADER is BI_BITFIELDS, the bmiColors member contains three DWORD color masks that specify the red, green, and blue components of each pixel. Each DWORD in the bitmap array represents a single pixel.
Declaration
public ushort BitCount { get; set; }
Property Value
Type | Description |
---|---|
System.UInt16 |
BlueMask
Color mask that specifies the blue component of each pixel, valid only if bV5Compression is set to BI_BITFIELDS.
Declaration
public uint BlueMask { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
ColorsImportant
The number of color indexes that are required for displaying the bitmap. If this value is zero, all colors are required.
Declaration
public uint ColorsImportant { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
ColorSpace
The color space of the DIB. See also LOGCOLORSPACE structure
Declaration
public ColorSpaceEnum ColorSpace { get; set; }
Property Value
Type | Description |
---|---|
ColorSpaceEnum |
ColorsUsed
The number of color indexes in the color table that are actually used by the bitmap. If this value is zero, the bitmap uses the maximum number of colors corresponding to the value of the bV5BitCount member for the compression mode specified by bV5Compression. If bV5ClrUsed is nonzero and bV5BitCount is less than 16, the bV5ClrUsed member specifies the actual number of colors the graphics engine or device driver accesses. If bV5BitCount is 16 or greater, the bV5ClrUsed member specifies the size of the color table used to optimize performance of the system color palettes. If bV5BitCount equals 16 or 32, the optimal color palette starts immediately following the BITMAPV5HEADER. If bV5ClrUsed is nonzero, the color table is used on palettized devices, and bV5ClrUsed specifies the number of entries.
Declaration
public uint ColorsUsed { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Compression
Specifies that the bitmap is not compressed. The bV5RedMask, bV5GreenMask, and bV5BlueMask members specify the red, green, and blue components of each pixel. This is valid when used with 16- and 32-bpp bitmaps.
Declaration
public BitmapCompressionMethods Compression { get; set; }
Property Value
Type | Description |
---|---|
BitmapCompressionMethods |
Endpoints
A CIEXYZTRIPLE structure that specifies the x, y, and z coordinates of the three colors that correspond to the red, green, and blue endpoints for the logical color space associated with the bitmap. This member is ignored unless the bV5CSType member specifies LCS_CALIBRATED_RGB.
Declaration
public CieXyzTripple Endpoints { get; set; }
Property Value
Type | Description |
---|---|
CieXyzTripple |
GammaBlue
Toned response curve for blue. Used if bV5CSType is set to LCS_CALIBRATED_RGB. Specify in unsigned fixed 16.16 format. The upper 16 bits are the unsigned integer value. The lower 16 bits are the fractional part.
Declaration
public uint GammaBlue { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
GammaGreen
Toned response curve for green. Used if bV5CSType is set to LCS_CALIBRATED_RGB. Specify in unsigned fixed 16.16 format. The upper 16 bits are the unsigned integer value. The lower 16 bits are the fractional part.
Declaration
public uint GammaGreen { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
GammaRed
Toned response curve for red. Used if bV5CSType is set to LCS_CALIBRATED_RGB. Specify in unsigned fixed 16.16 format. The upper 16 bits are the unsigned integer value. The lower 16 bits are the fractional part.
Declaration
public uint GammaRed { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
GreenMask
Color mask that specifies the green component of each pixel, valid only if bV5Compression is set to BI_BITFIELDS.
Declaration
public uint GreenMask { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Height
The height of the bitmap, in pixels. If the value of bV5Height is positive, the bitmap is a bottom-up DIB and its origin is the lower-left corner. If bV5Height value is negative, the bitmap is a top-down DIB and its origin is the upper-left corner. If bV5Height is negative, indicating a top-down DIB, bV5Compression must be either BI_RGB or BI_BITFIELDS. Top-down DIBs cannot be compressed. If bV5Compression is BI_JPEG or BI_PNG, the bV5Height member specifies the height of the decompressed JPEG or PNG image in pixels.
Declaration
public int Height { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Intent
Rendering intent for bitmap. This can be one of the following values: LCS_GM_ABS_COLORIMETRIC, LCS_GM_BUSINESS, LCS_GM_GRAPHICS, LCS_GM_IMAGES
Declaration
public ColorSpaceEnum Intent { get; set; }
Property Value
Type | Description |
---|---|
ColorSpaceEnum |
IsDibV5
Check if this is a DIB V5
Declaration
public bool IsDibV5 { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
OffsetToPixels
Calculate the offset to the pixels
Declaration
public uint OffsetToPixels { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Planes
The number of planes for the target device. This value must be set to 1.
Declaration
public ushort Planes { get; set; }
Property Value
Type | Description |
---|---|
System.UInt16 |
ProfileData
The offset, in bytes, from the beginning of the BITMAPV5HEADER structure to the start of the profile data. If the profile is embedded, profile data is the actual profile, and it is linked. (The profile data is the null-terminated file name of the profile.) This cannot be a Unicode string. It must be composed exclusively of characters from the Windows character set (code page 1252). These profile members are ignored unless the bV5CSType member specifies PROFILE_LINKED or PROFILE_EMBEDDED.
Declaration
public uint ProfileData { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
ProfileSize
Size, in bytes, of embedded profile data.
Declaration
public uint ProfileSize { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
RedMask
Color mask that specifies the red component of each pixel, valid only if bV5Compression is set to BI_BITFIELDS.
Declaration
public uint RedMask { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Reserved
This member has been reserved. Its value should be set to zero.
Declaration
public uint Reserved { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Size
The number of bytes required by the structure. Applications should use this member to determine which bitmap information header structure is being used.
Declaration
public uint Size { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
SizeImage
The size, in bytes, of the image. This may be set to zero for BI_RGB bitmaps. If bV5Compression is BI_JPEG or BI_PNG, bV5SizeImage is the size of the JPEG or PNG image buffer.
Declaration
public uint SizeImage { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Width
The width of the bitmap, in pixels. If bV5Compression is BI_JPEG or BI_PNG, the bV5Width member specifies the width of the decompressed JPEG or PNG image in pixels.
Declaration
public int Width { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
XPelsPerMeter
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.
Declaration
public int XPelsPerMeter { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
YPelsPerMeter
The vertical resolution, in pixels-per-meter, of the target device for the bitmap.
Declaration
public int YPelsPerMeter { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceCreate(Int32, Int32, UInt16)
Constructor with values
Declaration
public static BitmapInfoHeader Create(int width, int height, ushort bpp)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | width | int with the width of the bitmap |
System.Int32 | height | int with the height of the bitmap |
System.UInt16 | bpp | int with the bits per pixel of the bitmap |
Returns
Type | Description |
---|---|
BitmapInfoHeader |