DynaPDF Manual - Page 74

Previous Page 73   Index   Next Page 75

Path Painting and Construction
Page 74 of 839
pdfSetOnErrorProc(pdf, NULL, PDFError);
pdfSetDocInfo(pdf, diAuthor, "Jens Boschulte");
pdfSetDocInfo(pdf, diCreator, "C sample project");
pdfSetDocInfo(pdf, diSubject, "How to use clipping paths");
pdfSetDocInfo(pdf, diTitle, "Clipping paths");
pdfSetViewerPreferences(pdf, vpDisplayDocTitle, avNone);
pdfCreateNewPDF(pdf, "c:/cppout.pdf");
pdfSetPageCoords(pdf, pcTopDown);
pdfAppend(pdf);
// Nonzero Winding Number Rule
DrawPath(pdf, 0, 0, cmWinding, ddCounterClockwise, PDF_SKYBLUE);
DrawPath(pdf, 110, 0, cmWinding, ddClockwise, PDF_SKYBLUE);
// Even Odd Rule
DrawPath(pdf, 220, 0, cmEvenOdd, ddCounterClockwise, PDF_YELLOW);
DrawPath(pdf, 330, 0, cmEvenOdd, ddClockwise, PDF_YELLOW);
pdfEndPage(pdf);
pdfCloseFile(pdf);
pdfDeletePDF(pdf);
}
Winding
Even-Odd
C P C P C P C P
A clipping path is part of the graphics state. The only way to disable a clipping path is to restore
the graphics state. If the graphics state was not saved beforehand it is impossible to deactivate
the clipping region.
If a second clipping path is drawn while another one is still active then it will be intersected
with the current clipping path. The clipping area of the intersected clipping paths is never larger
than the initial clipping path.
 

Previous topic: Even-Odd Rule

Next topic: Color Spaces, Device Color Spaces