BmpPixelLayout Enum

The pixel layout written by BmpEncoder.

public enum BmpPixelLayout

Fields

NameValueDescription
Auto0BmpPixelLayout.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.
Bgr24124 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.
Bgra32232 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.
Indexed131 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.
Indexed444 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).
Indexed858 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).
Bgr565616 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.
Bgr555716 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.