PngInterlaceOption Enum

Definition

Specifies whether a Portable Network Graphics (PNG) format image is interlaced during encoding.

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 = 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);

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

Prodotto Versioni
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also