DynaPDF Manual - Page 319
Previous Page 318 Index Next Page 320

Function Reference
Page 319 of 860
pdfEndTemplate(pdf);
// A soft mask can only be activated with an extended graphics state.
TPDFExtGState gs;
pdfInitExtGState(&gs);
// Create the soft mask from the group and set it in the graphics state
// object. You can change more settings of the graphics state if
// necessary...
gs.SoftMask = pdfCreateSoftMask(pdf, grp, smtLuminosity, 0);
// Create the extended graphics state now
SI32 extGState = pdfCreateExtGState(pdf, &gs);
// And activate it...
pdfSetExtGState(pdf, extGState);
// The soft mask is now active, draw something on the page
pdfInsertImage(pdf, ...);
// The only way to deactivate a soft mask is to set a second extended
// graphics state that disables the soft mask.
gs.SoftMask
= NULL;
gs.SoftMaskNone = true;
SI32 restoreSoftMask = pdfCreateExtGState(pdf, &gs);
pdfSetExtGState(pdf, restoreSoftMask);
Return values:
If the function succeeds the return value is a pointer to the soft mask object. This pointer is required
to create an extended graphics state so that the mask can be activated. If the function fails the return
value is NULL.
CreateStdPattern
Syntax:
SI32 pdfCreateStdPattern(
const PPDF* IPDF,
// Instance pointer
TStdPattern Pattern, // Kind of pattern
double LineWidth,
// Line width to draw the pattern
double Distance,
// Distance between the lines
UI32 LineColor,
// Color of the lines
UI32 BackColor)
// Background color or NO_COLOR if transparent
typedef enum
{
spHorizontal, /* ----- */
spVertical,
/* ||||| */
spRDiagonal,
/* \\\\\ */
spLDiagonal,
/* ///// */
spCross,
/* +++++ */
spDiaCross
/* xxxxx */
}TStdPattern;
This function creates a hatch pattern. Several types of hatch pattern can be created with this
function. The line width, line distance, and line color can be set individually. If the pattern should be
transparent set the background color to NO_COLOR.
Previous topic: Soft mask types, Possible rendering issues, How to activate a soft mask?
Next topic: CreateStructureTree