Class BitmapDecoder
[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
BitmapDecoderInfoThe 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
ImagingFactoryThe factory.
fileStream
NativeFileStreamThe filename.
metadataOptions
DecodeOptionsThe 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
ImagingFactoryThe factory.
fileStream
NativeFileStreamThe filename.
guidVendorRef
GuidThe GUID vendor ref.
metadataOptions
DecodeOptionsThe 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
ImagingFactoryThe factory.
streamRef
IStreamThe stream ref.
metadataOptions
DecodeOptionsThe 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
ImagingFactoryThe factory.
streamRef
IStreamThe stream ref.
guidVendorRef
GuidThe GUID vendor ref.
metadataOptions
DecodeOptionsThe 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
ImagingFactoryThe factory.
containerFormatGuid
GuidThe 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
ImagingFactoryThe factory.
containerFormatGuid
GuidThe container format GUID.
guidVendorRef
GuidThe 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
ImagingFactoryThe factory.
streamRef
StreamThe stream ref.
metadataOptions
DecodeOptionsThe 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
ImagingFactoryThe factory.
streamRef
StreamThe stream ref.
guidVendorRef
GuidThe GUID vendor ref.
metadataOptions
DecodeOptionsThe 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
ImagingFactoryThe factory.
filename
stringThe filename.
desiredAccess
NativeFileAccessThe desired access.
metadataOptions
DecodeOptionsThe 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
ImagingFactoryThe factory.
filename
stringThe filename.
metadataOptions
DecodeOptionsThe 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
ImagingFactoryThe factory.
filename
stringThe filename.
guidVendorRef
Guid?The GUID vendor ref.
desiredAccess
NativeFileAccessThe desired access.
metadataOptions
DecodeOptionsThe metadata options.
BitmapDecoder(nint)
public BitmapDecoder(nint nativePtr)
Parameters
nativePtr
nint
Properties
ColorContexts
[Obsolete("Use TryGetColorContexts instead")]
public ColorContext[] ColorContexts { get; }
Property Value
ContainerFormat
Retrieves the image's container format.
public Guid ContainerFormat { get; }
Property Value
DecoderInfo
Retrieves an BitmapDecoderInfo for the image.
public BitmapDecoderInfo DecoderInfo { get; }
Property Value
FrameCount
Retrieves the total number of frames in the image.
public int FrameCount { get; }
Property Value
MetadataQueryReader
Proxy function for the GetMetadataQueryReader method.
public MetadataQueryReader MetadataQueryReader { get; }
Property Value
Preview
Retrieves a preview image, if supported.
public BitmapSource Preview { get; }
Property Value
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
Methods
CopyPalette(Palette)
Proxy function for the CopyPalette method.
public void CopyPalette(Palette paletteRef)
Parameters
paletteRef
PaletteNo 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
intThe 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
IStreamThe stream to use for initialization.
cacheOptions
DecodeOptionsThe cache options.
QueryCapability(IStream)
Retrieves the capabilities of the decoder based on the specified stream.
public BitmapDecoderCapabilities QueryCapability(IStream streamRef)
Parameters
streamRef
IStreamThe 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
ImagingFactoryThe 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