|
Graphic Rendering |
Top Previous Next |
|
Using wPDF you can create PDF files by exporting bitmaps, metafiles or using the property 'Canvas' which provides you with a compatible TCanvas object. This canvas object can be used similar to the Canvas provided by a TPaintBox, a TPrinter or similar. It's 'handle' can be used with many Windows GDI commands, such as IntersectClipRect, SetWorldTransform or SetViewPort.
Usually you have to use StartPage to make the export possible. Otherwise the Canvas is not valid and DrawBitmap is not possible. An important exception of this rule is DrawMetafile which can automatically create and close a page which exactly matches the dimensions of the exported metafile.
Notes:
1) All coordinate values used by the following procedures use the x,y resolution which was selected in StartPage()!
2) DrawBitmap and other "Draw" functions export the data right away to PDF - unlike the API functions used with the 'Canvas' object, i.w. Canvas.StretchDraw. Here all collected graphic operations are exported when (a) the page is closed or (b) the API CloseCanvas is executed. So you need to use the method CloseCanvas if you mix Draw... and Canvas functions. |