通过


PngInterlaceOption 枚举

定义

指定在编码过程中是否交错可移植网络图形(PNG)格式图像。

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

字段

名称 说明
Default 0

确定 PngBitmapEncoder 图像是否应交错。

On 1

生成的位图图像交错。

Off 2

生成的位图图像不会交错。

示例

下面的示例演示如何使用 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 时,先显示一个字段中的行,然后显示第二个字段中的行。

适用于

另请参阅