PngBitmapEncoder.Interlace 属性

定义

获取或设置一个值,该值指示可移植网络图形 (PNG) 位图是否应交错。

public:
 property System::Windows::Media::Imaging::PngInterlaceOption Interlace { System::Windows::Media::Imaging::PngInterlaceOption get(); void set(System::Windows::Media::Imaging::PngInterlaceOption value); };
public System.Windows.Media.Imaging.PngInterlaceOption Interlace { get; set; }
member this.Interlace : System.Windows.Media.Imaging.PngInterlaceOption with get, set
Public Property Interlace As PngInterlaceOption

属性值

PngInterlaceOption

Interlace 值之一。 默认值为 Default

示例

以下示例演示如何使用 Interlace 该属性。

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 时,首先显示一个字段中的行,然后显示第二个字段中的行。

适用于