BitmapDecoder.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 virtual System.Collections.ObjectModel.ReadOnlyCollection<System.Windows.Media.Imaging.BitmapFrame> Frames { get; }
member this.Frames : System.Collections.ObjectModel.ReadOnlyCollection<System.Windows.Media.Imaging.BitmapFrame>
Public Overridable ReadOnly Property Frames As ReadOnlyCollection(Of BitmapFrame)

プロパティ値

ReadOnlyCollection<BitmapFrame>

BitmapFrame のインスタンス。 このプロパティには既定値はありません。

次のコード例では、a として使用する方法を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)

注釈

タグ付けされたイメージ ファイル形式 (TIFF) イメージとグラフィックス交換形式 (GIF) イメージのみが複数のフレームをサポートします。

BitmapFrameこのプロパティによって返されるすべてのオブジェクトは固定されます。

適用対象

こちらもご覧ください