Bagikan melalui


BmpBitmapEncoder Konstruktor

Definisi

Menginisialisasi instans baru kelas BmpBitmapEncoder.

public:
 BmpBitmapEncoder();
[System.Security.SecurityCritical]
public BmpBitmapEncoder ();
public BmpBitmapEncoder ();
Public Sub New ()
Atribut

Contoh

Contoh berikut menunjukkan cara menginisialisasi untuk mengodekan BmpBitmapEncoder gambar bitmap baru.

FileStream^ stream = gcnew FileStream("new.bmp", FileMode::Create);
BmpBitmapEncoder^ encoder = gcnew BmpBitmapEncoder();
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.bmp", FileMode.Create);
BmpBitmapEncoder encoder = new BmpBitmapEncoder();
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.bmp", FileMode.Create)
Dim encoder As New BmpBitmapEncoder()
Dim myTextBlock As New TextBlock()
myTextBlock.Text = "Codec Author is: " + encoder.CodecInfo.Author.ToString()
encoder.Frames.Add(BitmapFrame.Create(image))
encoder.Save(stream)

Berlaku untuk