[]
IWICBitmapDecoder
[Guid("9EDDE9E7-8DEE-47ea-99DF-E6FAF2ED44BF")]
public class BitmapDecoder : ComObject, IDisposable, IUnknown
Initializes a new instance of the BitmapDecoder class.
public BitmapDecoder(IntPtr nativePtr)
nativePtr System.IntPtrThe native pointer.
HRESULT IWICBitmapDecoder::CopyPalette([In, Optional] IWICPalette* pIPalette)
public void CopyPalette(Palette paletteRef)
paletteRef PaletteInitializes a new instance of the BitmapDecoder class from a BitmapDecoderInfo.
public static BitmapDecoder Create(BitmapDecoderInfo bitmapDecoderInfo)
bitmapDecoderInfo BitmapDecoderInfoThe bitmap decoder info.
Initializes a new instance of the BitmapDecoder class from a IStream.
public static BitmapDecoder Create(ImagingFactory factory, IStream streamRef, DecodeOptions metadataOptions)
factory ImagingFactoryThe factory.
streamRef IStreamThe stream ref.
metadataOptions DecodeOptionsThe metadata options.
Initializes a new instance of the BitmapDecoder class from a IStream.
public static BitmapDecoder Create(ImagingFactory factory, IStream streamRef, Guid guidVendorRef, DecodeOptions metadataOptions)
factory ImagingFactoryThe factory.
streamRef IStreamThe stream ref.
guidVendorRef System.GuidThe GUID vendor ref.
metadataOptions DecodeOptionsThe metadata options.
Initializes a new instance of the BitmapDecoder class.
public static BitmapDecoder Create(ImagingFactory factory, Guid containerFormatGuid, Guid guidVendorRef)
factory ImagingFactoryThe factory.
containerFormatGuid System.GuidThe container format GUID.
guidVendorRef System.GuidThe GUID vendor ref.
Initializes a new instance of the BitmapDecoder class from a guid. BitmapDecoderGuids for a list of default supported decoder.
public static BitmapDecoder Create(ImagingFactory factory, Guid containerFormatGuid)
factory ImagingFactoryThe factory.
containerFormatGuid System.GuidThe container format GUID.
Initializes a new instance of the BitmapDecoder class from a filestream.
public static BitmapDecoder Create(ImagingFactory factory, FileStream fileStream, DecodeOptions metadataOptions)
factory ImagingFactoryThe factory.
fileStream System.IO.FileStreamThe filename.
metadataOptions DecodeOptionsThe metadata options.
Initializes a new instance of the BitmapDecoder class from a filestream.
public static BitmapDecoder Create(ImagingFactory factory, FileStream fileStream, Guid guidVendorRef, DecodeOptions metadataOptions)
factory ImagingFactoryThe factory.
fileStream System.IO.FileStreamThe filename.
guidVendorRef System.GuidThe GUID vendor ref.
metadataOptions DecodeOptionsThe metadata options.
Initializes a new instance of the BitmapDecoder class from a IStream.
public static BitmapDecoder Create(ImagingFactory factory, Stream streamRef, DecodeOptions metadataOptions)
factory ImagingFactoryThe factory.
streamRef System.IO.StreamThe stream ref.
metadataOptions DecodeOptionsThe metadata options.
Initializes a new instance of the BitmapDecoder class from a IStream.
public static BitmapDecoder Create(ImagingFactory factory, Stream streamRef, Guid guidVendorRef, DecodeOptions metadataOptions)
factory ImagingFactoryThe factory.
streamRef System.IO.StreamThe stream ref.
guidVendorRef System.GuidThe GUID vendor ref.
metadataOptions DecodeOptionsThe metadata options.
Initializes a new instance of the BitmapDecoder class from a file.
public static BitmapDecoder Create(ImagingFactory factory, string filename, NativeFileAccess desiredAccess, DecodeOptions metadataOptions)
factory ImagingFactoryThe factory.
filename stringThe filename.
desiredAccess NativeFileAccessThe desired access.
metadataOptions DecodeOptionsThe metadata options.
Initializes a new instance of the BitmapDecoder class from a file in read mode.
public static BitmapDecoder Create(ImagingFactory factory, string filename, DecodeOptions metadataOptions)
factory ImagingFactoryThe factory.
filename stringThe filename.
metadataOptions DecodeOptionsThe metadata options.
Initializes a new instance of the BitmapDecoder class from a file.
public static BitmapDecoder Create(ImagingFactory factory, string filename, Guid? guidVendorRef, NativeFileAccess desiredAccess, DecodeOptions metadataOptions)
factory ImagingFactoryThe factory.
filename stringThe filename.
guidVendorRef System.Guid?The GUID vendor ref.
desiredAccess NativeFileAccessThe desired access.
metadataOptions DecodeOptionsThe metadata options.
Clean up any resources being used.
protected override void Dispose(bool disposing)
disposing boolHRESULT IWICBitmapDecoder::GetColorContexts([In] unsigned int cCount,[InOut, Buffer, Optional] IWICColorContext** ppIColorContexts,[Out] unsigned int* pcActualCount)
public HResult GetColorContexts(int count, ComArray<ColorContext> colorContextsOut, out int actualCountRef)
count intcolorContextsOut ComArray<ColorContext>actualCountRef intHRESULT IWICBitmapDecoder::GetColorContexts([In] unsigned int cCount,[InOut, Buffer, Optional] IWICColorContext** ppIColorContexts,[Out] unsigned int* pcActualCount)
public HResult GetColorContexts(int count, ColorContext[] colorContextsOut, out int actualCountRef)
count intcolorContextsOut ColorContext[]actualCountRef intHRESULT IWICBitmapDecoder::GetContainerFormat([Out] GUID* pguidContainerFormat)
public Guid GetContainerFormat()
HRESULT IWICBitmapDecoder::GetDecoderInfo([Out] IWICBitmapDecoderInfo** ppIDecoderInfo)
public BitmapDecoderInfo GetDecoderInfo()
HRESULT IWICBitmapDecoder::GetFrame([In] unsigned int index,[Out] IWICBitmapFrameDecode** ppIBitmapFrame)
public BitmapFrameDecode GetFrame(int index)
index intHRESULT IWICBitmapDecoder::GetFrameCount([Out] unsigned int* pCount)
public int GetFrameCount()
HRESULT IWICBitmapDecoder::GetMetadataQueryReader([Out] IWICMetadataQueryReader** ppIMetadataQueryReader)
public MetadataQueryReader GetMetadataQueryReader()
HRESULT IWICBitmapDecoder::GetPreview([Out] IWICBitmapSource** ppIBitmapSource)
public BitmapSource GetPreview()
HRESULT IWICBitmapDecoder::GetThumbnail([Out] IWICBitmapSource** ppIThumbnail)
public BitmapSource GetThumbnail()
Initializes the decoder with the provided stream.
public void Initialize(IStream stream, DecodeOptions cacheOptions)
stream IStreamThe stream to use for initialization.
cacheOptions DecodeOptionsThe cache options.
Queries the capabilities of the decoder based on the specified stream.
public BitmapDecoderCapabilities QueryCapability(IStream stream)
stream IStreamThe stream to retrieve the decoder capabilities from..
Capabilities of the decoder
Get the ColorContext of the image (if any)
public HResult TryGetColorContexts(ImagingFactory imagingFactory, out ColorContext[] colorContexts)
imagingFactory ImagingFactoryThe factory for creating new color contexts
colorContexts ColorContext[]The color context array, or null
When the image format does not support color contexts,
Get the ColorContext of the image (if any)
public ColorContext[] TryGetColorContexts(ImagingFactory imagingFactory)
imagingFactory ImagingFactorynull if the decoder does not support color contexts; otherwise an array of zero or more ColorContext objects
Performs an explicit conversion from System.IntPtr to BitmapDecoder.
public static explicit operator BitmapDecoder(IntPtr nativePointer)
nativePointer System.IntPtr