BitmapEncoder.Frames Property


Gets or sets the individual frames within an image.

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

public virtual IList<BitmapFrame> Frames { get; set; }

Property Value

Type: System.Collections.Generic.IList<BitmapFrame>

A collection of BitmapFrame objects within the image.

Exception Condition

The BitmapFrame value that is passed to the encoder is null.

Only Tagged Image File Format (TIFF), Graphics Interchange Format (GIF), and Microsoft Windows Media Photo images support more than one frame. Attempts to add additional frames to formats that do not support them will result in only the first frame being encoded.

You cannot use this property in Extensible Application Markup Language (XAML).

The following example shows how to add a frame to an encoder.

FileStream stream = new FileStream("empty.tif", FileMode.Create);
TiffBitmapEncoder encoder = new TiffBitmapEncoder();
TextBlock myTextBlock = new TextBlock();
myTextBlock.Text = "Codec Author is: " + encoder.CodecInfo.Author.ToString();

.NET Framework
Available since 3.0
Return to top