BitmapEncoder.Frames 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定影像中的各個影格。
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)
屬性值
影像中的物件集合 BitmapFrame 。
例外狀況
BitmapFrame傳遞給編碼器的值為 null。
範例
以下範例展示了如何為編碼器添加影格。
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)
備註
只有標籤影像檔案格式(TIFF)、圖形交換格式(GIF)及Microsoft Windows媒體照片影像支援多幀。 嘗試在不支援這些格式中加入額外幀數,通常只會編碼第一幀。
XAML 文字使用
你無法在可擴充應用程式標記語言(XAML)中使用此特性。