Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

Graphics

Currently support for drawing graphics in the PDF document is not much yet. If you want to draw things in the PDF document, you will need to use the CPath class. A path defines shapes, trajectories,and regions of all sorts. They are used to draw lines, define the shapes of filled areas, and specify boundaries for clipping other graphics.

Like text, paths are descripted by a state object. The CState class is used to present the state of a path.

A path can be created by:

    graph::CState state( 1.0, graph::CState::round_cap ) ;
    graph::CPath path( state ) ;
    path.MoveTo( 100, 100 ) ;
    path.LineTo( 200, 100 ) ;

The above code will draw a line from coordinate (100, 100) to (200, 100). It will be a horizonal line. Units are in user space unit (1/72 inches by default).

Like the text objects, path objects will be added to the page by ) CPage::DrawPath( ):

    page.DrawPath( path ) ;

After you add the path to the page, the line will appear in the page.

There are also many things to play with. Read the CState constructor and the CPath constructor for more details.


Generated on Sun Feb 2 09:17:07 2003 for libpdf++ by doxygen1.2.16