Class BmpEncoder
- Namespace
- SixLabors.ImageSharp.Formats.Bmp
- Assembly
- SixLabors.ImageSharp.dll
Image encoder for writing an image to a stream as a Windows bitmap.
public sealed class BmpEncoder : QuantizingImageEncoder, IImageEncoder
- Inheritance
-
BmpEncoder
- Implements
- Inherited Members
Constructors
BmpEncoder()
Initializes a new instance of the BmpEncoder class.
public BmpEncoder()
Properties
BitsPerPixel
Gets the number of bits per pixel.
public BmpBitsPerPixel? BitsPerPixel { get; init; }
Property Value
SupportTransparency
Gets a value indicating whether the encoder should support transparency. Note: Transparency support only works together with 32 bits per pixel. This option will change the default behavior of the encoder of writing a bitmap version 3 info header with no compression. Instead a bitmap version 4 info header will be written with the BITFIELDS compression.
public bool SupportTransparency { get; init; }
Property Value
Methods
Encode<TPixel>(Image<TPixel>, Stream, CancellationToken)
protected override void Encode<TPixel>(Image<TPixel> image, Stream stream, CancellationToken cancellationToken) where TPixel : unmanaged, IPixel<TPixel>
Parameters
image
Image<TPixel>stream
StreamcancellationToken
CancellationToken
Type Parameters
TPixel