Added typed compression property get.

This commit is contained in:
Eugene Wang
2025-11-12 01:30:36 -05:00
parent 5c8f1f2df6
commit 8afc52c82b

View File

@@ -187,12 +187,7 @@ namespace Windows.Win32.Graphics.Gdi
return strideTest; return strideTest;
} }
/// <summary> /// <inheritdoc/>
/// Returns a <see cref="System.String" /> that represents this instance.
/// </summary>
/// <returns>
/// A <see cref="System.String" /> that represents this instance.
/// </returns>
public override string ToString() public override string ToString()
{ {
return new StringBuilder().Append("BitmapInfoHeader:") return new StringBuilder().Append("BitmapInfoHeader:")
@@ -201,7 +196,7 @@ namespace Windows.Win32.Graphics.Gdi
.Append("\r\n\tHeight = " + biHeight) .Append("\r\n\tHeight = " + biHeight)
.Append("\r\n\tPlanes = " + biPlanes) .Append("\r\n\tPlanes = " + biPlanes)
.Append("\r\n\tBitCount = " + biBitCount) .Append("\r\n\tBitCount = " + biBitCount)
.Append("\r\n\tCompression = " + biCompression) .Append("\r\n\tCompression = " + Compression)
.Append("\r\n\tSizeImage = " + biSizeImage) .Append("\r\n\tSizeImage = " + biSizeImage)
.Append("\r\n\tXPixelsPerMeter = " + biXPelsPerMeter) .Append("\r\n\tXPixelsPerMeter = " + biXPelsPerMeter)
.Append("\r\n\tYPixelsPerMeter = " + biYPelsPerMeter) .Append("\r\n\tYPixelsPerMeter = " + biYPelsPerMeter)
@@ -209,37 +204,42 @@ namespace Windows.Win32.Graphics.Gdi
.Append("\r\n\tColorImportant = " + biClrImportant).ToString(); .Append("\r\n\tColorImportant = " + biClrImportant).ToString();
} }
///// <summary> /// <summary>
///// Indicates the bitmap compression of <seealso cref="BITMAPINFOHEADER"/>. /// Gets the bitmap compression type.
///// </summary> /// </summary>
//public enum CompressionType : uint public CompressionType Compression { get { return (CompressionType)biCompression; } }
//{
// /// <summary> /// <summary>
// /// An uncompressed format. /// Indicates the bitmap compression of <seealso cref="BITMAPINFOHEADER"/>.
// /// </summary> /// </summary>
// BI_RGB = 0, public enum CompressionType : uint
// /// <summary> {
// /// A run-length encoded (RLE) format for bitmaps with 8 bpp. 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 Bitmap Compression. /// <summary>
// /// </summary> /// An uncompressed format.
// BI_RLE8 = 1, /// </summary>
// /// <summary> BI_RGB = 0,
// /// An RLE, format for bitmaps with 4 bpp. The compression format is a 2-byte format consisting of a count byte followed by two word-length color indexes. For more information, see Bitmap Compression. /// <summary>
// /// </summary> /// A run-length encoded (RLE) format for bitmaps with 8 bpp. 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 Bitmap Compression.
// BI_RLE4 = 2, /// </summary>
// /// <summary> BI_RLE8 = 1,
// /// Specifies that the bitmap is not compressed and that the color table consists of three DWORD color masks that specify the red, green, and blue components of each pixel. /// <summary>
// /// This is valid when used with 16- and 32-bpp bitmaps. /// An RLE, format for bitmaps with 4 bpp. The compression format is a 2-byte format consisting of a count byte followed by two word-length color indexes. For more information, see Bitmap Compression.
// /// </summary> /// </summary>
// BI_BITFIELDS = 3, BI_RLE4 = 2,
// /// <summary> /// <summary>
// /// Indicates that the image is a JPEG image. /// Specifies that the bitmap is not compressed and that the color table consists of three DWORD color masks that specify the red, green, and blue components of each pixel.
// /// </summary> /// This is valid when used with 16- and 32-bpp bitmaps.
// BI_JPEG = 4, /// </summary>
// /// <summary> BI_BITFIELDS = 3,
// /// Indicates that the image is a PNG image. /// <summary>
// /// </summary> /// Indicates that the image is a JPEG image.
// BI_PNG = 5 /// </summary>
//} BI_JPEG = 4,
/// <summary>
/// Indicates that the image is a PNG image.
/// </summary>
BI_PNG = 5
}
} }
//[StructLayout(LayoutKind.Sequential, Pack = 1)] //[StructLayout(LayoutKind.Sequential, Pack = 1)]