ProgressiveRender Class

Definition

A render of the SoftwareRasterizer that draws in time slices: Continue(TimeSpan) draws until its budget is used, leaving a valid partial image in Target, and the next call resumes where it stopped. Start one with BeginRender(PdfPage, Bitmap, RenderOptions) or BeginRender(DisplayList, Bitmap, in Matrix, CancellationToken, IProgress<Double>?).

public sealed class ProgressiveRender : IDisposable

Remarks

Viewer capability 2 (issue #97), like PDFium's progressive rendering (FPDF_RenderPageBitmap_Start, FPDF_RenderPage_Continue, FPDF_RenderPage_Close). The finished bitmap is the same, pixel for pixel, however the render is sliced: between slices the rasterizer keeps its graphics state stack, transform and clip, and every operation of the display list is drawn whole, in order (DisplayListReplay). After any slice the bitmap holds the operations drawn so far, composited as they will be in the end.

Nothing blocks or waits: a single-threaded host (Blazor WebAssembly) draws a slice, presents or yields to its event loop, and continues, for example while (!render.Continue(TimeSpan.FromMilliseconds(8))) await Task.Yield();. The rasterizer renders nothing else until the render completes, is cancelled, fails or is disposed. Dispose it to abandon it: the bitmap keeps the partial image and the rasterizer is free again, with nothing left behind that changes its next render.

Tip: use kind:method, kind:property, kind:ctor. Press Esc to clear.

Properties (4)

Methods (2)