PngBitmapEncoder PngBitmapEncoder PngBitmapEncoder Constructor

定義

PngBitmapEncoder クラスの新しいインスタンスを初期化します。Initializes a new instance of the PngBitmapEncoder class.

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

次の例は、をPngBitmapEncoder初期化して新しいビットマップイメージをエンコードする方法を示しています。The following example demonstrates how to initialize a PngBitmapEncoder to encode a new bitmap image.

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

適用対象