Sdílet prostřednictvím


LateBoundBitmapDecoder.Frames Vlastnost

Definice

Získá obsah jednotlivých snímků v rastrovém obrázku.

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)

Hodnota vlastnosti

ReadOnlyCollection<BitmapFrame>

Instance .BitmapFrame Tato vlastnost nemá výchozí hodnotu.

Příklady

Následující příklad ukazuje, jak použít BitmapFrame jako BitmapSource.


// 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)

Poznámky

LateBoundBitmapDecoder Vzhledem k tomu, že se stahuje asynchronně, je možné po stažení a dekódování obsahu změnit podkladovou kolekciFrames. Při stahování obsahu se kolekce vždy vrátí aspoň jednu položku. Po dokončení BitmapFrame stahování a dekódování se automaticky změní jeho podkladový obsah. Jinými slovy, může se změnit pouze objekt kolekce; skutečný objekt rámce zůstává stejný.

Všechny snímky získané během LateBoundBitmapDecoder stahování obrázku vrátí šířku/výšku 1,1 , dokud snímky nedokončí stahování.

Obrázky ve formátu GIF (Tagged Image File Format) a Graphics Interchange Format (GIF) podporují více než jeden rámec.

Všechny BitmapFrame objekty, které tato vlastnost vrací, jsou zmrazeny.

Platí pro

Viz také