PngInterlaceOption 列舉

定義

指定可攜式網路圖形 (PNG) 格式影像在編碼期間是否為交錯式。

public enum class PngInterlaceOption
public enum PngInterlaceOption
type PngInterlaceOption = 
Public Enum PngInterlaceOption
繼承
PngInterlaceOption

欄位

Default 0

PngBitmapEncoder 判斷影像是否應該為交錯式。

Off 2

產生的點陣圖影像不為交錯式。

On 1

產生的點陣圖影像為交錯式。

範例

下列範例示範如何使用 Interlace 類別的 PngBitmapEncoder 屬性。

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)

備註

交錯是指在兩個欄位中顯示 PNG 框架的程式。 一個欄位包含框架的偶數線,而另一個欄位則包含框架的奇數線。 檢視 PNG 時,會先顯示一個欄位中的行,然後顯示第二個欄位中的行。

適用於

另請參閱