Share via


BitmapEncoder.Frames Propriété

Définition

Obtient ou définit les trames individuelles dans une image.

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)

Valeur de propriété

IList<BitmapFrame>

Collection d'objets BitmapFrame dans l'image.

Exceptions

La valeur de BitmapFrame passée à l’encodeur est null.

Exemples

L’exemple suivant montre comment ajouter un cadre à un encodeur.

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)

Remarques

Seules les images TIFF (Tagged Image File Format), Graphics Interchange Format (GIF) et Microsoft Windows Media Photo prennent en charge plusieurs images. Les tentatives d’ajout d’images supplémentaires aux formats qui ne les prennent pas en charge entraînent uniquement l’encodage du premier cadre.

Utilisation du texte XAML

Vous ne pouvez pas utiliser cette propriété dans le langage XAML (Extensible Application Markup Language).

S’applique à

Voir aussi