共用方式為


GifBitmapEncoder 建構函式

定義

初始化 GifBitmapEncoder 類別的新執行個體。

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

範例

下列範例示範如何初始化 GifBitmapEncoder 以編碼新的點陣圖影像。

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)

適用於