Enum ImagePixelFormat

Enum ImagePixelFormat

Namespace: Aspose.Words.Saving
Assembly: Aspose.Words.dll (25.12.0)

Specifies the pixel format for the generated images of document pages.

public enum ImagePixelFormat

Fields

Format16BppArgb1555 = 2

16 bits per pixel, ARGB.

Format16BppRgb555 = 0

16 bits per pixel, RGB.

Format16BppRgb565 = 1

16 bits per pixel, RGB.

Format1bppIndexed = 10

1 bit per pixel, Indexed.

Format24BppRgb = 3

24 bits per pixel, RGB.

Format32BppArgb = 5

32 bits per pixel, ARGB.

Format32BppPArgb = 6

32 bits per pixel, ARGB, premultiplied alpha.

Format32BppRgb = 4

32 bits per pixel, RGB.

Format48BppRgb = 7

48 bits per pixel, RGB.

Format64BppArgb = 8

64 bits per pixel, ARGB.

Format64BppPArgb = 9

64 bits per pixel, ARGB, premultiplied alpha.

Examples

Shows how to select a bit-per-pixel rate with which to render a document to an image.

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

                                                                                                // When we save the document as an image, we can pass a SaveOptions object to
                                                                                                // select a pixel format for the image that the saving operation will generate.
                                                                                                // Various bit per pixel rates will affect the quality and file size of the generated image.
                                                                                                ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFormat.Png);
                                                                                                imageSaveOptions.PixelFormat = imagePixelFormat;

                                                                                                // We can clone ImageSaveOptions instances.
                                                                                                Assert.That(imageSaveOptions.Clone(), Is.Not.EqualTo(imageSaveOptions));

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