Editar

Partilhar via


GifBitmapEncoder Constructor

Definition

Initializes a new instance of the GifBitmapEncoder class.

public:
 GifBitmapEncoder();
[System.Security.SecurityCritical]
public GifBitmapEncoder ();
public GifBitmapEncoder ();
Public Sub New ()
Attributes

Examples

The following example demonstrates how to initialize a GifBitmapEncoder to encode a new bitmap image.

FileStream^ stream = gcnew FileStream("new.gif", FileMode::Create);
GifBitmapEncoder^ encoder = gcnew GifBitmapEncoder();
TextBlock^ myTextBlock = gcnew TextBlock();
myTextBlock->Text = "Codec Author is: " + encoder->CodecInfo->Author->ToString();
encoder->Frames->Add(BitmapFrame::Create(image));
encoder->Save(stream);
FileStream stream = new FileStream("new.gif", FileMode.Create);
GifBitmapEncoder encoder = new GifBitmapEncoder();
TextBlock myTextBlock = new TextBlock();
myTextBlock.Text = "Codec Author is: " + encoder.CodecInfo.Author.ToString();
encoder.Frames.Add(BitmapFrame.Create(image));
encoder.Save(stream);
Dim stream As New FileStream("new.gif", FileMode.Create)
Dim encoder As New GifBitmapEncoder()
Dim myTextBlock As New TextBlock()
myTextBlock.Text = "Codec Author is: " + encoder.CodecInfo.Author.ToString()
encoder.Frames.Add(BitmapFrame.Create(image))
encoder.Save(stream)

Applies to