PngInterlaceOption 枚举

定义

指定是否在编码过程中对可移植网络图形 (PNG) 格式图像进行隔行扫描。Specifies whether a Portable Network Graphics (PNG) format image is interlaced during encoding.

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

字段

Default 0

PngBitmapEncoder 决定是否应该对图像进行隔行扫描。The PngBitmapEncoder determines whether the image should be interlaced.

Off 2

不对生成的位图图像进行隔行扫描。The resulting bitmap image is not interlaced.

On 1

对生成的位图图像进行隔行扫描。The resulting bitmap image is interlaced.

示例

下面的示例演示如何使用Interlace PngBitmapEncoder类的属性。The following example demonstrates how to use the Interlace property of the PngBitmapEncoder class.

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)

注解

交错指的是将PNGPNG帧显示在两个字段中的过程。Interlacing refers to the process of displaying a PNGPNG frame in two fields. 一个字段包含帧的偶数行, 另一个字段包含帧的奇数行。One field contains the even lines of the frame, while the other field contains the odd lines of the frame. PNGPNG查看时, 将首先显示一个字段中的行, 然后显示第二个字段中的行。When the PNGPNG is viewed, the lines in one field are displayed first, and then the lines in the second field are displayed.

适用于

另请参阅