ImagePixelFormat

ImagePixelFormat enumeration

Gibt das Pixelformat für die generierten Bilder der Dokumentseiten an.

public enum ImagePixelFormat

Werte

NameWertBeschreibung
Format16BppRgb555016 Bit pro Pixel, RGB.
Format16BppRgb565116 Bit pro Pixel, RGB.
Format16BppArgb1555216 Bit pro Pixel, ARGB.
Format24BppRgb324 Bit pro Pixel, RGB.
Format32BppRgb432 Bit pro Pixel, RGB.
Format32BppArgb532 Bit pro Pixel, ARGB.
Format32BppPArgb632 Bit pro Pixel, ARGB, vormultipliziertes Alpha.
Format48BppRgb748 Bit pro Pixel, RGB.
Format64BppArgb864 Bit pro Pixel, ARGB.
Format64BppPArgb964 Bit pro Pixel, ARGB, vormultipliziertes Alpha.
Format1bppIndexed101 Bit pro Pixel, indiziert.

Beispiele

Zeigt, wie Sie eine Bit-pro-Pixel-Rate auswählen, mit der ein Dokument in ein Bild gerendert wird.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.ParagraphFormat.Style = doc.Styles["Heading 1"];
builder.Writeln("Hello world!");
builder.InsertImage(ImageDir + "Logo.jpg");

// Wenn wir das Dokument als Bild speichern, können wir ein SaveOptions-Objekt übergeben an
// Wählen Sie ein Pixelformat für das Bild aus, das beim Speichern generiert wird.
// Verschiedene Bit-pro-Pixel-Raten wirken sich auf die Qualität und Dateigröße des generierten Bildes aus.
ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFormat.Png);
imageSaveOptions.PixelFormat = imagePixelFormat;

// Wir können ImageSaveOptions-Instanzen klonen.
Assert.AreNotEqual(imageSaveOptions, imageSaveOptions.Clone());

doc.Save(ArtifactsDir + "ImageSaveOptions.PixelFormat.png", imageSaveOptions);

Siehe auch