PngInterlaceOption Énumération

Définition

Spécifie si une image au format PNG (Portable Network Graphics) est entrelacée lors de l’encodage.

public enum class PngInterlaceOption
public enum PngInterlaceOption
type PngInterlaceOption = 
Public Enum PngInterlaceOption
Héritage
PngInterlaceOption

Champs

Default 0

PngBitmapEncoder détermine si l’image doit être entrelacée.

Off 2

L’image bitmap résultante n’est pas entrelacée.

On 1

L’image bitmap résultante est entrelacée.

Exemples

L’exemple suivant montre comment utiliser la Interlace propriété de la PngBitmapEncoder classe.

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)

Remarques

L’interlacement fait référence au processus d’affichage d’un cadre PNG dans deux champs. Un champ contient les lignes même du cadre, tandis que l’autre contient les lignes impaires du cadre. Lorsque le PNG est affiché, les lignes d’un champ sont affichées en premier, puis les lignes du deuxième champ sont affichées.

S’applique à

Voir aussi