Table of Contents

Class BitmapDecoder

Namespace
SharpDX.WIC
Assembly
SharpDX.Direct2D1.dll
[Guid("9EDDE9E7-8DEE-47ea-99DF-E6FAF2ED44BF")]
public class BitmapDecoder : ComObject
Inheritance
BitmapDecoder
Derived

Constructors

BitmapDecoder(BitmapDecoderInfo)

Initializes a new instance of the BitmapDecoder class from a BitmapDecoderInfo.

public BitmapDecoder(BitmapDecoderInfo bitmapDecoderInfo)

Parameters

bitmapDecoderInfo BitmapDecoderInfo

The bitmap decoder info.

BitmapDecoder(ImagingFactory, NativeFileStream, DecodeOptions)

Initializes a new instance of the BitmapDecoder class from a file stream.

public BitmapDecoder(ImagingFactory factory, NativeFileStream fileStream, DecodeOptions metadataOptions)

Parameters

factory ImagingFactory

The factory.

fileStream NativeFileStream

The filename.

metadataOptions DecodeOptions

The metadata options.

BitmapDecoder(ImagingFactory, NativeFileStream, Guid, DecodeOptions)

Initializes a new instance of the BitmapDecoder class from a file stream.

public BitmapDecoder(ImagingFactory factory, NativeFileStream fileStream, Guid guidVendorRef, DecodeOptions metadataOptions)

Parameters

factory ImagingFactory

The factory.

fileStream NativeFileStream

The filename.

guidVendorRef Guid

The GUID vendor ref.

metadataOptions DecodeOptions

The metadata options.

BitmapDecoder(ImagingFactory, IStream, DecodeOptions)

Initializes a new instance of the BitmapDecoder class from a SharpDX.Win32.IStream.

public BitmapDecoder(ImagingFactory factory, IStream streamRef, DecodeOptions metadataOptions)

Parameters

factory ImagingFactory

The factory.

streamRef IStream

The stream ref.

metadataOptions DecodeOptions

The metadata options.

BitmapDecoder(ImagingFactory, IStream, Guid, DecodeOptions)

Initializes a new instance of the BitmapDecoder class from a SharpDX.Win32.IStream.

public BitmapDecoder(ImagingFactory factory, IStream streamRef, Guid guidVendorRef, DecodeOptions metadataOptions)

Parameters

factory ImagingFactory

The factory.

streamRef IStream

The stream ref.

guidVendorRef Guid

The GUID vendor ref.

metadataOptions DecodeOptions

The metadata options.

BitmapDecoder(ImagingFactory, Guid)

Initializes a new instance of the BitmapDecoder class from a guid. BitmapDecoderGuids for a list of default supported decoder.

public BitmapDecoder(ImagingFactory factory, Guid containerFormatGuid)

Parameters

factory ImagingFactory

The factory.

containerFormatGuid Guid

The container format GUID.

BitmapDecoder(ImagingFactory, Guid, Guid)

Initializes a new instance of the BitmapDecoder class.

public BitmapDecoder(ImagingFactory factory, Guid containerFormatGuid, Guid guidVendorRef)

Parameters

factory ImagingFactory

The factory.

containerFormatGuid Guid

The container format GUID.

guidVendorRef Guid

The GUID vendor ref.

BitmapDecoder(ImagingFactory, Stream, DecodeOptions)

Initializes a new instance of the BitmapDecoder class from a SharpDX.Win32.IStream.

public BitmapDecoder(ImagingFactory factory, Stream streamRef, DecodeOptions metadataOptions)

Parameters

factory ImagingFactory

The factory.

streamRef Stream

The stream ref.

metadataOptions DecodeOptions

The metadata options.

BitmapDecoder(ImagingFactory, Stream, Guid, DecodeOptions)

Initializes a new instance of the BitmapDecoder class from a SharpDX.Win32.IStream.

public BitmapDecoder(ImagingFactory factory, Stream streamRef, Guid guidVendorRef, DecodeOptions metadataOptions)

Parameters

factory ImagingFactory

The factory.

streamRef Stream

The stream ref.

guidVendorRef Guid

The GUID vendor ref.

metadataOptions DecodeOptions

The metadata options.

BitmapDecoder(ImagingFactory, string, NativeFileAccess, DecodeOptions)

Initializes a new instance of the BitmapDecoder class from a file.

public BitmapDecoder(ImagingFactory factory, string filename, NativeFileAccess desiredAccess, DecodeOptions metadataOptions)

Parameters

factory ImagingFactory

The factory.

filename string

The filename.

desiredAccess NativeFileAccess

The desired access.

metadataOptions DecodeOptions

The metadata options.

BitmapDecoder(ImagingFactory, string, DecodeOptions)

Initializes a new instance of the BitmapDecoder class from a file in read mode.

public BitmapDecoder(ImagingFactory factory, string filename, DecodeOptions metadataOptions)

Parameters

factory ImagingFactory

The factory.

filename string

The filename.

metadataOptions DecodeOptions

The metadata options.

BitmapDecoder(ImagingFactory, string, Guid?, NativeFileAccess, DecodeOptions)

Initializes a new instance of the BitmapDecoder class from a file.

public BitmapDecoder(ImagingFactory factory, string filename, Guid? guidVendorRef, NativeFileAccess desiredAccess, DecodeOptions metadataOptions)

Parameters

factory ImagingFactory

The factory.

filename string

The filename.

guidVendorRef Guid?

The GUID vendor ref.

desiredAccess NativeFileAccess

The desired access.

metadataOptions DecodeOptions

The metadata options.

BitmapDecoder(nint)

public BitmapDecoder(nint nativePtr)

Parameters

nativePtr nint

Properties

ColorContexts

[Obsolete("Use TryGetColorContexts instead")]
public ColorContext[] ColorContexts { get; }

Property Value

ColorContext[]

ContainerFormat

Retrieves the image's container format.

public Guid ContainerFormat { get; }

Property Value

Guid

DecoderInfo

Retrieves an BitmapDecoderInfo for the image.

public BitmapDecoderInfo DecoderInfo { get; }

Property Value

BitmapDecoderInfo

FrameCount

Retrieves the total number of frames in the image.

public int FrameCount { get; }

Property Value

int

MetadataQueryReader

Proxy function for the GetMetadataQueryReader method.

public MetadataQueryReader MetadataQueryReader { get; }

Property Value

MetadataQueryReader

Preview

Retrieves a preview image, if supported.

public BitmapSource Preview { get; }

Property Value

BitmapSource

Remarks

Not all formats support previews. Only the native Microsoft?Windows Digital Photo (WDP) codec support previews.

Thumbnail

Proxy function for the GetThumbnail method.

public BitmapSource Thumbnail { get; }

Property Value

BitmapSource

Methods

CopyPalette(Palette)

Proxy function for the CopyPalette method.

public void CopyPalette(Palette paletteRef)

Parameters

paletteRef Palette

No documentation.

Dispose(bool)

protected override void Dispose(bool disposing)

Parameters

disposing bool

GetFrame(int)

Retrieves the specified frame of the image.

public BitmapFrameDecode GetFrame(int index)

Parameters

index int

The particular frame to retrieve.

Returns

BitmapFrameDecode

A reference that receives a reference to the BitmapFrameDecode.

Initialize(IStream, DecodeOptions)

Initializes the decoder with the provided stream.

public void Initialize(IStream stream, DecodeOptions cacheOptions)

Parameters

stream IStream

The stream to use for initialization.

cacheOptions DecodeOptions

The cache options.

QueryCapability(IStream)

Retrieves the capabilities of the decoder based on the specified stream.

public BitmapDecoderCapabilities QueryCapability(IStream streamRef)

Parameters

streamRef IStream

The stream to retrieve the decoder capabilities from.

Returns

BitmapDecoderCapabilities

The BitmapDecoderCapabilities of the decoder.

Remarks

Custom decoder implementations should save the current position of the specified SharpDX.Win32.IStream, read whatever information is necessary in order to determine which capabilities it can provide for the supplied stream, and restore the stream position.

TryGetColorContexts(ImagingFactory)

Get the ColorContext of the image (if any)

public ColorContext[] TryGetColorContexts(ImagingFactory imagingFactory)

Parameters

imagingFactory ImagingFactory

Returns

ColorContext[]

null if the decoder does not support color contexts; otherwise an array of zero or more ColorContext objects

TryGetColorContexts(ImagingFactory, out ColorContext[])

Get the ColorContext of the image (if any)

public Result TryGetColorContexts(ImagingFactory imagingFactory, out ColorContext[] colorContexts)

Parameters

imagingFactory ImagingFactory

The factory for creating new color contexts

colorContexts ColorContext[]

The color context array, or null

Returns

Result

Remarks

When the image format does not support color contexts, UnsupportedOperation is returned.

Operators

explicit operator BitmapDecoder(nint)

public static explicit operator BitmapDecoder(nint nativePtr)

Parameters

nativePtr nint

Returns

BitmapDecoder