22.03.2015 Views

DLI Implementation and Reference Guide - Datalogics

DLI Implementation and Reference Guide - Datalogics

DLI Implementation and Reference Guide - Datalogics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Displaying Line Drawings 10.7.<br />

Path Drawing Methods<br />

The directly-drawn shapes are useful for a great number of graphics, but they do not<br />

permit filling of complex arbitrary shapes without the construction of a path. For that<br />

reason, a second set of drawing operators was added. These operators simply<br />

construct <strong>and</strong> draw a path, which may be arbitrarily complex. It may also be<br />

disjointed.<br />

The DLPDFPATH structure will contain a path of any size, allocating additional<br />

memory as needed. Path construction is via methods which add segments to the<br />

existing path. These methods seek to include both the PDF <strong>and</strong> PostScript graphics<br />

operators. When completed, the path may be added to a content area. The path is not<br />

destroyed when imaged <strong>and</strong> may be reused any number of times. The DLPDFPATH<br />

structure also includes a provision for a CTM Matrix, which may be used to<br />

transform the position <strong>and</strong> appearance of the path.<br />

Within the path, a current point is maintained. This will be undefined initially, or after<br />

a dlpdfpathaddclose, <strong>and</strong> will be the end point of the segment added at all other<br />

times. Some operators require that the current point be established prior to adding a<br />

segment of that type. Others will add a straight line segment drawn from the current<br />

position to the start of the defined segment prior to a segment. This behavior mimics<br />

the drawing mechanism in PostScript.<br />

The first parameter of all of these methods, except dlpdfpathcreate <strong>and</strong><br />

dlpdfcontentdrawpath, is a pointer to a valid DLPDFPATH structure.<br />

dlpdfpathcreate<br />

This method will return a pointer to a new DLPDFPATH structure. The path’s contents<br />

will be empty, its current position will be undefined, <strong>and</strong> its matrix will be set to the<br />

unity matrix. This structure will persist until specifically deleted by the<br />

dlpdfpathdestroy method.<br />

The DLPDFPATH is not specific to a document or content structure. It may be shared<br />

across many documents <strong>and</strong> placed within any number of content structures.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!