BitmapEncoder.Frames Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the individual frames within an 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)
Property Value
A collection of BitmapFrame objects within the image.
Exceptions
The BitmapFrame value that is passed to the encoder is null
.
Examples
The following example shows how to add a frame to an encoder.
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)
Remarks
Only Tagged Image File Format (TIFF), Graphics Interchange Format (GIF), and Microsoft Windows Media Photo images support more than one frame. Attempts to add additional frames to formats that do not support them will result in only the first frame being encoded.
XAML Text Usage
You cannot use this property in Extensible Application Markup Language (XAML).
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기