Xojo Conferences
XDCMay2019MiamiUSA
MBSOct2019CologneDE

DynaPDF Manual - Page 560

Previous Page 559   Index   Next Page 561

Function Reference
Page 560 of 766
Matrix
TCTM
{1, 0, 0, 1, 0, 0}
MiterLimit
float
10.0f
StrokeColor
double[32]
Black
StrokeColorSpace
TExtColorSpace, IColorSpace*
esDeviceGray, NULL
StrokePattern
IPattern*
NULL
If vector graphics should be processed in a unique device color space then it is usually best to
convert PDF colors directly to the device color space with ConvColor() and to store the device color
then in the graphics state. The data type of the members FillColor and StrokeColor must then be
changed to unsigned int (UI32). There is no need to store the fill and stroke color space in the
graphics state in this case.
Vector graphics are defined in page or form space depending on the object type in which the
graphics are stored. The mapping to user space is achieved by tranforming the coordinate pairs with
the current transformation matrix of the graphics state.
For example, if the TMoveTo callback function would be executed the application must transform
the provided coordinates to user space as follows:
// x and y are the parameters of the TMoveTo callback function
Transform(m_GState.Matrix, x, y);
Vector graphics in PDF are always defined as paths. A path is invisible until it will be filled or
stroked. PDF supports primitive path painting operators like bezier curves, lines, and rectangles
only. Circles and ellipses are always drawn with bezier curves in PDF.
Once a path was fully defined it is normally consumed by a TClosePath() or TClipPath() callback
function call. If this is not the case the path must be deleted when the page was fully processed.
When a path must be filled, stroked, or discarded the TClosePath callback function is executed. The
parameter Mode of the callback function specifies what must be done with the path:
fmFillNoClose
// Fill the path (Winding)
fmFillEvOddNoClose
// Fill the path (Even Odd)
fmFillStroke
// Close, fill and stroke the path (Winding)
fmFillStrokeEvOdd
// Close, fill and stroke the path (Even Odd)
fmFillStrokeNoClose
// Fill and stroke the path (Winding)
fmFillStrokeEvOddNoClose // Fill and stroke the path (Even Odd)
fmStrokeNoClose
// Stroke the path
fmStroke
// Close and stroke the path
fmNoFill
// Discard the path
fmClose
// Close the path with a straight line segment
A normal path is not part of the graphics state. Once a path was drawn it must be deleted.
The TClipPath callback function supports the same modes than TClosePath but the required actions
that must be executed are different. A clipping path is part of the graphics state. If the graphics state
contains already a clipping path, the existing path must be intersected with new one. The resulting
clipping path must then be stored in the graphics state.
 

Previous topic: Vector Graphics

Next topic: PlaceImage