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)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public virtual ReadOnlyCollection<BitmapFrame> Frames { get; }
/** @property */
public ReadOnlyCollection<BitmapFrame> get_Frames ()

public function get Frames () : ReadOnlyCollection<BitmapFrame>

You cannot use this property in XAML.

Property Value

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);

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Show: