संपादित करें

इसके माध्यम से साझा किया गया


PngInterlaceOption Enum

Definition

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
Inheritance
PngInterlaceOption

Fields

Name Value Description
Default 0

The PngBitmapEncoder determines whether the image should be interlaced.

On 1

The resulting bitmap image is interlaced.

Off 2

The resulting bitmap image is not interlaced.

Examples

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)

Remarks

Interlacing refers to the process of displaying a PNG frame in two fields. One field contains the even lines of the frame, while the other field contains the odd lines of the frame. When the PNG is viewed, the lines in one field are displayed first, and then the lines in the second field are displayed.

Applies to

See also