BitmapEncoder.Frames Propriété

Définition

Obtient ou définit les images 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é

Collection d’objets BitmapFrame dans l’image.

Exceptions

La BitmapFrame valeur transmise à l’encodeur est null.

Exemples

L’exemple suivant montre comment ajouter un frame à 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

Seuls le format de fichier image étiqueté (TIFF), le format GIF (Graphics Interchange Format) et Microsoft Windows images 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 de la première image.

Utilisation du texte XAML

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

S’applique à

Voir aussi