BitmapDecoder Class
Represents a container for bitmap frames. Each bitmap frame is a BitmapSource. This abstract class provides a base set of functionality for all derived decoder objects.
System.Windows.Threading::DispatcherObject
System.Windows.Media.Imaging::BitmapDecoder
System.Windows.Media.Imaging::BmpBitmapDecoder
System.Windows.Media.Imaging::GifBitmapDecoder
System.Windows.Media.Imaging::IconBitmapDecoder
System.Windows.Media.Imaging::JpegBitmapDecoder
System.Windows.Media.Imaging::LateBoundBitmapDecoder
System.Windows.Media.Imaging::PngBitmapDecoder
System.Windows.Media.Imaging::TiffBitmapDecoder
System.Windows.Media.Imaging::WmpBitmapDecoder
Assembly: PresentationCore (in PresentationCore.dll)
The BitmapDecoder type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | CodecInfo | Gets information that describes this codec. |
![]() | ColorContexts | Gets a value that represents the color profile associated with a bitmap, if one is defined. |
![]() | Dispatcher | Gets the Dispatcher this DispatcherObject is associated with. (Inherited from DispatcherObject.) |
![]() | Frames | Gets the content of an individual frame within a bitmap. |
![]() | IsDownloading | Gets a value that indicates if the decoder is currently downloading content. |
![]() | Metadata | Gets an instance of BitmapMetadata that represents the global metadata associated with this bitmap, if metadata is defined. |
![]() | Palette | Gets the BitmapPalette associated with this decoder. |
![]() | Preview | Gets a BitmapSource that represents the global preview of this bitmap, if one is defined. |
![]() | Thumbnail | Gets a BitmapSource that represents the thumbnail of the bitmap, if one is defined. |
| Name | Description | |
|---|---|---|
![]() | CheckAccess | Determines whether the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.) |
![]() ![]() | Create(Stream, BitmapCreateOptions, BitmapCacheOption) | Creates a BitmapDecoder from a Stream by using the specified BitmapCreateOptions and BitmapCacheOption. |
![]() ![]() | Create(Uri, BitmapCreateOptions, BitmapCacheOption) | Creates a BitmapDecoder from a Uri by using the specified BitmapCreateOptions and BitmapCacheOption. |
![]() ![]() | Create(Uri, BitmapCreateOptions, BitmapCacheOption, RequestCachePolicy) | Creates a BitmapDecoder from a Uri by using the specified BitmapCreateOptions, BitmapCacheOption and RequestCachePolicy. |
![]() | CreateInPlaceBitmapMetadataWriter | Creates an instance of InPlaceBitmapMetadataWriter, which can be used to update the metadata of a bitmap. |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Frees resources and performs other cleanup operations before the BitmapDecoder is reclaimed by garbage collection. (Overrides Object::Finalize().) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Converts the current value of a BitmapDecoder to a String. (Overrides Object::ToString().) |
![]() | VerifyAccess | Enforces that the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.) |
| Name | Description | |
|---|---|---|
![]() | DownloadCompleted | Occurs when a BitmapDecoder has finished downloading bitmap content. |
![]() | DownloadFailed | Occurs when bitmap content failed to download. |
![]() | DownloadProgress | Occurs when a BitmapDecoder has made progress downloading bitmap content. |
BitmapDecoder is not a BitmapFrame itself; rather, it is a container for BitmapFrame objects. Each BitmapFrame in the container can potentially have different attributes, including different sizes, resolutions, or palettes.
Unless a specific codec is selected, Windows Presentation Foundation (WPF) uses automatic run-time discovery to identify the format of an image and match it with the appropriate codec. This discovery process allows a codec developed by an independent software vendor (ISV) to be automatically discoverable by the system. To select a specific codec, the derived BitmapDecoder or BitmapEncoder, such as the TiffBitmapDecoder class, should be used.
Tagged Image File Format (TIFF) and Graphics Interchange Format (GIF) are the only implemented image formats that support multiple frames.
The following example demonstrates how to use the Create(Uri, BitmapCreateOptions, BitmapCacheOption) method to create a decoder for a given image. The first BitmapFrame of the image is used as the source of an Image control.
The following code example demonstrates how to use the built in TiffBitmapDecoder to open and decode a Tagged Image File Format (TIFF) bitmap. The resulting BitmapSource is used as the Source of an Image element.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
