Components for Developers
© 2000-2012, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
How to Create Lines with different styles

Example
Collapse All

Example

C++

[copy to clipboard]
PM_DOCUMENT doc = PM_DOCUMENT_New();
PM_RECT rect = {0, 0, 300, 300};
PM_PAGE page = PM_DOCUMENT_AddPage(doc, rect);
PM_CANVAS canvas = PM_PAGE_GetCanvas(page);

float pointY = 10.0f;
const float step = 15.0f;

PM_CANVAS_SetLineWidth(canvas, 5);
PM_CANVAS_MoveTo(canvas, 10, pointY);
PM_CANVAS_DrawLineTo(canvas, 60, pointY + 50);
PM_CANVAS_DrawLineTo(canvas, 110, pointY);
PM_CANVAS_Stroke(canvas);
pointY += step;

PM_CANVAS_SetLineCapStyle(canvas, lcRound);
PM_CANVAS_SetLineJoinStyle(canvas, ljRound);
PM_CANVAS_MoveTo(canvas, 10, pointY);
PM_CANVAS_DrawLineTo(canvas, 60, pointY + 50);
PM_CANVAS_DrawLineTo(canvas, 110, pointY);
PM_CANVAS_Stroke(canvas);
pointY += step;

PM_CANVAS_SetLineCapStyle(canvas, lcProjectingSquare);
PM_CANVAS_SetLineJoinStyle(canvas, ljMiter);
PM_CANVAS_MoveTo(canvas, 10, pointY);
PM_CANVAS_DrawLineTo(canvas, 60, pointY + 50);
PM_CANVAS_DrawLineTo(canvas, 110, pointY);
PM_CANVAS_Stroke(canvas);
pointY += step;

PM_CANVAS_SetLineCapStyle(canvas, lcProjectingSquare);
PM_CANVAS_SetLineJoinStyle(canvas, ljBevel);
PM_CANVAS_MoveTo(canvas, 10, pointY);
PM_CANVAS_DrawLineTo(canvas, 60, pointY + 50);
PM_CANVAS_DrawLineTo(canvas, 110, pointY);
PM_CANVAS_Stroke(canvas);
pointY += step;

PM_DOCUMENT_Save(doc, "LineStyles.pdf");
PM_DOCUMENT_Free(doc);

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2012, Two Pilots