BitmapEncoder.Frames Egenskap

Definition

Hämtar eller anger de enskilda ramarna i en bild.

public:
 virtual property System::Collections::Generic::IList<System::Windows::Media::Imaging::BitmapFrame ^> ^ Frames { System::Collections::Generic::IList<System::Windows::Media::Imaging::BitmapFrame ^> ^ get(); void set(System::Collections::Generic::IList<System::Windows::Media::Imaging::BitmapFrame ^> ^ value); };
public virtual System.Collections.Generic.IList<System.Windows.Media.Imaging.BitmapFrame> Frames { get; set; }
member this.Frames : System.Collections.Generic.IList<System.Windows.Media.Imaging.BitmapFrame> with get, set
Public Overridable Property Frames As IList(Of BitmapFrame)

Egenskapsvärde

En samling BitmapFrame objekt i bilden.

Undantag

Värdet BitmapFrame som skickas till kodaren är null.

Exempel

I följande exempel visas hur du lägger till en ram i en kodare.

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();
encoder.Frames.Add(BitmapFrame.Create(image));
MessageBox.Show(myPalette.Colors.Count.ToString());
encoder.Save(stream);
Dim stream As New FileStream("empty.tif", FileMode.Create)
Dim encoder As New TiffBitmapEncoder()
Dim myTextBlock As New TextBlock()
myTextBlock.Text = "Codec Author is: " + encoder.CodecInfo.Author.ToString()
encoder.Frames.Add(BitmapFrame.Create(image))
MessageBox.Show(myPalette.Colors.Count.ToString())
encoder.Save(stream)

Kommentarer

Endast TIFF (Tagged Image File Format), Graphics Interchange Format (GIF) och Microsoft Windows Media Photo-bilder stöder mer än en bildruta. Försök att lägga till ytterligare ramar i format som inte stöder dem resulterar bara i att den första ramen kodas.

XAML-textanvändning

Du kan inte använda den här egenskapen i XAML (Extensible Application Markup Language).

Gäller för

Se även