語言

LateBoundBitmapDecoder.Frames 屬性

定義

取得點陣圖中單一幀的內容。

public:
 virtual property System::Collections::ObjectModel::ReadOnlyCollection<System::Windows::Media::Imaging::BitmapFrame ^> ^ Frames { System::Collections::ObjectModel::ReadOnlyCollection<System::Windows::Media::Imaging::BitmapFrame ^> ^ get(); };
public override System.Collections.ObjectModel.ReadOnlyCollection<System.Windows.Media.Imaging.BitmapFrame> Frames { get; }
member this.Frames : System.Collections.ObjectModel.ReadOnlyCollection<System.Windows.Media.Imaging.BitmapFrame>
Public Overrides ReadOnly Property Frames As ReadOnlyCollection(Of BitmapFrame)

屬性值

BitmapFrame的實例。 此房產無預設價值。

範例

以下範例示範如何將 作為 BitmapFrameBitmapSource。


// 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);
' Open a Stream and decode a TIFF image
Dim imageStreamSource As New FileStream("tulipfarm.tif", FileMode.Open, FileAccess.Read, FileShare.Read)
Dim decoder As New TiffBitmapDecoder(imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default)
Dim bitmapSource As BitmapSource = decoder.Frames(0)

' Draw the Image
Dim myImage1 As New Image()
myImage1.Source = bitmapSource
myImage1.Stretch = Stretch.None
myImage1.Margin = New Thickness(20)

備註

由於 a LateBoundBitmapDecoder 是非同步下載,因此在內容下載與解碼後,底 Frames 層集合有可能改變。 在內容下載期間,收藏總會回傳至少一件物品。 下載與解碼完成後,會 BitmapFrame 自動更改底層內容。 換句話說,只有集合物件會改變;實際的框架物件保持不變。

在圖片下載期間取得 LateBoundBitmapDecoder 的任何幀,會在幀下載完成前回傳寬 1,1 度/高度。

只有標籤影像檔案格式(TIFF)和圖形交換格式(GIF)影像支援多幀。

所有 BitmapFrame 回傳此屬性的物件皆為凍結。

適用於

另請參閱