This documentation is archived and is not being maintained.

BitmapDecoder.Frames Property

Gets the content of an individual frame within a bitmap.

Namespace:  System.Windows.Media.Imaging
Assembly:  PresentationCore (in PresentationCore.dll)

public virtual ReadOnlyCollection<BitmapFrame> Frames { get; }

Property Value

Type: System.Collections.ObjectModel.ReadOnlyCollection<BitmapFrame>
An instance of BitmapFrame. This property has no default value.

Only Tagged Image File Format (TIFF) and Graphics Interchange Format (GIF) images support more than one frame.

Any BitmapFrame objects returned by this property are frozen.

The following code example demonstrates how to use a BitmapFrame as a BitmapSource.



// Open a Stream and decode a TIFF image
Stream imageStreamSource = new FileStream("tulipfarm.tif", FileMode.Open, FileAccess.Read, FileShare.Read);
TiffBitmapDecoder decoder = new TiffBitmapDecoder(imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
BitmapSource bitmapSource = decoder.Frames[0];

// Draw the Image
Image myImage1 = new Image();
myImage1.Source = bitmapSource;
myImage1.Stretch = Stretch.None;
myImage1.Margin = new Thickness(20);


.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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.
Show: