BitmapEncoder.Frames Propriedade

Definição

Obtém ou define os frames individuais dentro de uma imagem.

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)

Valor de Propriedade

Uma coleção de BitmapFrame objetos dentro da imagem.

Exceções

O BitmapFrame valor que é passado ao codificador é null.

Exemplos

O exemplo seguinte mostra como adicionar um frame a um codificador.

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)

Observações

Apenas as imagens Tagged Image File Format (TIFF), Graphics Interchange Format (GIF) e Microsoft Windows Media Photo suportam mais do que um frame. As tentativas de adicionar frames adicionais a formatos que não os suportam resultarão em apenas o primeiro frame ser codificado.

Utilização de Texto XAML

Não pode usar esta propriedade na Extensible Application Markup Language (XAML).

Aplica-se a

Ver também