BmpPixelLayout Enum
The pixel layout written by BmpEncoder.
public enum BmpPixelLayoutFields
| Name | Value | Description |
|---|---|---|
Auto | 0 | BmpPixelLayout.Bgra32 for pixel formats with alpha, BmpPixelLayout.Bgr24 otherwise. This is the default: no sample and no alpha value is ever discarded. The indexed and 16-bit layouts are never selected automatically. |
Bgr24 | 1 | 24 bits per pixel, blue, green and red, in a BITMAPINFOHEADER with BI_RGB: the most widely readable BMP layout. Alpha is discarded, so a pixel format with alpha requires BmpEncoder.BackgroundColor. |
Bgra32 | 2 | 32 bits per pixel, blue, green, red and straight alpha, in a BITMAPV4HEADER with BI_BITFIELDS and an explicit alpha mask, so that readers never have to guess whether the fourth byte is transparency or padding. |
Indexed1 | 3 | 1 bit per pixel: indexes into a palette of at most 2 colors, in a BITMAPINFOHEADER. The palette holds the colors of the image exactly when they fit; otherwise BmpEncoder.AllowColorReduction is required. Alpha is discarded, so a pixel format with alpha requires BmpEncoder.BackgroundColor. |
Indexed4 | 4 | 4 bits per pixel: indexes into a palette of at most 16 colors, in a BITMAPINFOHEADER, with the rules of BmpPixelLayout.Indexed1. Can be run-length encoded (BmpCompression.RunLength). |
Indexed8 | 5 | 8 bits per pixel: indexes into a palette of at most 256 colors, in a BITMAPINFOHEADER, with the rules of BmpPixelLayout.Indexed1. Can be run-length encoded (BmpCompression.RunLength). |
Bgr565 | 6 | 16 bits per pixel, 5 bits of red, 6 of green and 5 of blue, in a BITMAPINFOHEADER with BI_BITFIELDS and its three masks. 8-bit samples lose their low bits (nearest rounding), so BmpEncoder.AllowBitDepthReduction is required. Alpha is discarded, so a pixel format with alpha requires BmpEncoder.BackgroundColor. |
Bgr555 | 7 | 16 bits per pixel, 5 bits per channel and one unused bit, in a BITMAPINFOHEADER with BI_RGB (the implicit 16-bit masks of the format), with the rules of BmpPixelLayout.Bgr565. |