Class BmpDecoder
Image decoder for generating an image out of a Windows bitmap stream.
Inherited Members
Namespace: SixLabors.ImageSharp.Formats.Bmp
Assembly: SixLabors.ImageSharp.dll
Syntax
public sealed class BmpDecoder : SpecializedImageDecoder<BmpDecoderOptions>, ISpecializedImageDecoder<BmpDecoderOptions>, IImageDecoder
Properties
| Edit this page View SourceInstance
Gets the shared instance.
Declaration
public static BmpDecoder Instance { get; }
Property Value
Type | Description |
---|---|
BmpDecoder |
Methods
| Edit this page View SourceCreateDefaultSpecializedOptions(DecoderOptions)
A factory method for creating the default specialized options.
Declaration
protected override BmpDecoderOptions CreateDefaultSpecializedOptions(DecoderOptions options)
Parameters
Type | Name | Description |
---|---|---|
DecoderOptions | options | The general decoder options. |
Returns
Type | Description |
---|---|
BmpDecoderOptions | The new BmpDecoderOptions. |
Overrides
| Edit this page View SourceDecode(BmpDecoderOptions, Stream, CancellationToken)
Decodes the image from the specified stream to an Image of a specific pixel type.
Declaration
protected override Image Decode(BmpDecoderOptions options, Stream stream, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
BmpDecoderOptions | options | The specialized decoder options. |
Stream | stream | The Stream containing image data. |
CancellationToken | cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
Image | The Image<TPixel>. |
Overrides
Remarks
This method is designed to support the ImageSharp internal infrastructure and is not recommended for direct use.
Exceptions
Type | Condition |
---|---|
ImageFormatException | Thrown if the encoded image contains errors. |
Decode<TPixel>(BmpDecoderOptions, Stream, CancellationToken)
Decodes the image from the specified stream to an Image<TPixel> of a specific pixel type.
Declaration
protected override Image<TPixel> Decode<TPixel>(BmpDecoderOptions options, Stream stream, CancellationToken cancellationToken) where TPixel : unmanaged, IPixel<TPixel>
Parameters
Type | Name | Description |
---|---|---|
BmpDecoderOptions | options | The specialized decoder options. |
Stream | stream | The Stream containing image data. |
CancellationToken | cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
Image<TPixel> | The Image<TPixel>. |
Type Parameters
Name | Description |
---|---|
TPixel | The pixel format. |
Overrides
Remarks
This method is designed to support the ImageSharp internal infrastructure and is not recommended for direct use.
Exceptions
Type | Condition |
---|---|
ImageFormatException | Thrown if the encoded image contains errors. |
Identify(DecoderOptions, Stream, CancellationToken)
Reads the raw image information from the specified stream.
Declaration
protected override ImageInfo Identify(DecoderOptions options, Stream stream, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
DecoderOptions | options | The general decoder options. |
Stream | stream | The Stream containing image data. |
CancellationToken | cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
ImageInfo | The ImageInfo object. |
Overrides
Remarks
This method is designed to support the ImageSharp internal infrastructure and is not recommended for direct use.
Exceptions
Type | Condition |
---|---|
ImageFormatException | Thrown if the encoded image contains errors. |