DynaPDF Manual - Page 703

Previous Page 702   Index   Next Page 704

Function Reference
Page 703 of 777
is, the dash pattern is restarted and the dash phase is reapplied to it at the beginning of each sub
path.
How to create a dotted line?
As described above, a line dash pattern is drawn by applying the current line cap style and join style.
A round cap is painted as semicircular arc with a diameter equal to the line width. If we set the
length of the first on-state to 0 then we get a circle, or dot. The second number of the dash array
specifies the length of the off-state measured from the centers of our circles.
It is quite easy to draw the line now:
float dash[2] = {0.0f, 60.0f};
pdfSetLineWidth(pdf, 30);
pdfSetLineCapStyle(pdf, csRoundCap);
pdfSetLineDashPattern2(pdf, dash, 0.0f);
pdfMoveTo(pdf, 50, 50);
pdfLineTo(pdf, 550, 50);
pdfStrokePath(pdf);
Output:
60 Units
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
SetLineDashPatternEx (obsolete)
Syntax:
LBOOL pdfSetLineDashPatternEx(
const PPDF* IPDF,
// Instance pointer
const double* Dash, // Array of doubles representing the pattern
UI32 NumValues,
// Array length
SI32 Phase)
// Dash phase
This function is obsolete, please use SetLineDashPattern2() instead.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
 

Previous topic: SetLineDashPattern (obsolete), SetLineDashPattern2

Next topic: SetLineJoinStyle