ComOfficeKitby KDAN API Reference for Windows
Table of Contents

Class PageImage

Namespace
ComOfficeKit
Assembly
ComOfficeKit.dll

A page drawn by RenderPage(int, double): BGRA32 pixels, premultiplied, every one opaque, the top row first. That is what WPF's PixelFormats.Pbgra32 and WinUI's WriteableBitmap take. The image holds its own copy of the pixels: it needs no disposal and outlives its document.

public sealed class PageImage
Inheritance
PageImage
Inherited Members

Properties

Dpi

The dots per inch the page was drawn at.

public double Dpi { get; }

Property Value

double

Height

The height in pixels.

public int Height { get; }

Property Value

int

Pixels

The pixels: Height rows of Stride bytes, each pixel blue, green, red, alpha.

public ReadOnlyMemory<byte> Pixels { get; }

Property Value

ReadOnlyMemory<byte>

Stride

The bytes from one row to the next: Width × 4.

public int Stride { get; }

Property Value

int

Width

The width in pixels.

public int Width { get; }

Property Value

int

Methods

SavePng(Stream)

Writes the image as a PNG (8-bit RGB) to destination, at its current position. The stream is flushed and left open.

public void SavePng(Stream destination)

Parameters

destination Stream

A writable stream.

SavePng(string)

Writes the image as a PNG file (8-bit RGB), replacing a file already there.

public void SavePng(string path)

Parameters

path string

Where to write it.