Namespace TallComponents.PDF.Rasterizer

Class DrawJob

Represents an asynchronous drawing job.

The code below shows one way to use a DrawJob. Instead of simply calling Page.Draw(), one can create a DrawJob, start it, and then do some additional work before obtaining the drawn bitmap. drawJob = new DrawJob(page); Bitmap mybitmap = new Bitmap( ( int ) ( page.Width / 72 * dpi ), ( int ) ( page.Height / 72 * dpi ) ); float scale = ( float ) ( dpi / 72F ); Matrix transformation = new Matrix(); transformation.Scale( scale, scale ); drawJob.Start(mybitmap, renderSettings, PageBoundary.Default, transformation); // ...Drawing will start on a separate thread. In the meantine, one could do // some additional work here. // Wait until drawing has finished. drawJob.Wait(); // Obtain a copy of the bitmap that has been drawn. System.Drawing.Bitmap bitmap = drawJob.GetBitmap(); One will typically use a DrawJob to render a page progesssively. After a drawing job has been started, it is possible to obtain intermediate bitmap results by calling DrawJob.GetBitmap() while the job is running. This can be done at arbitrary moments, for example via a timer.An easier way is to subscribe to the Updated event of the DrawJob and retrieve a new bitmap in the event handler. The Updated event will be fired regularly, but it will only be fired when the bitmap has actually been updated. After finishing the drawing job, the Updated event will be raised one last time. drawJob = new DrawJob(page); drawJob.Updated += new EventHandler(drawJob_Updated); ... drawJob.Start(...); ... void drawJob_Updated(object sender, EventArgs e) { // Obtain a copy of the bitmap for as far as it has been drawn. System.Drawing.Bitmap bitmap = drawJob.GetBitmap(); ... }

Syntax

public class DrawJob : Object,IDisposable

Constructors

Properties

Methods

Events

Download PDFRasterizer.NET 3.0
We will send you a download link
Why do we ask your email address?
We send tips that speed up your evaluation
We let you know about bug fixes
You can always unsubscribe with one click
We never share your address with a 3rd party
Thank you for your download

We have sent an email with a download link.