Share via


BitmapEncoder.Frames 屬性

定義

取得或設定影像內的個別框架。

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)

屬性值

IList<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) 。

適用於

另請參閱