TPDFlibShapeWatermark
Data types, page layout
Description
TPDFlibShapeWatermark is the concrete TPDFlibWatermarkBase subclass introduced in v3.223.0 that stamps a vector shape onto a page range with fill and stroke colours, line width and opacity
A rectangle, circle or ellipse sizes itself from Width and Height; a polygon, Bezier curve chain or straight line takes its geometry from the point list set with SetPoints, with coordinates local to the shape top-left corner so the nine-point Position grid still applies
Syntax
Delphi
TPDFlibShapeWatermark = Class(TPDFlibWatermarkBase)
Public
Shape: TPDFlibWatermarkShape;
Width, Height: Double;
Filled: Boolean;
FillR, FillG, FillB: Double;
LineR, LineG, LineB: Double;
LineWidth: Double;
Constructor Create; Override;
Procedure SetPoints(Const XYPairs: Array Of Double);
Function PointCount: Integer;
Function Apply(Lib: TObject): Integer; Override;
End;Fields
| Shape | The vector shape to draw, from TPDFlibWatermarkShape |
|---|---|
| Width, Height | The bounding size used by wsRectangle, wsCircle and wsEllipse |
| Filled | Fill and outline when True, outline only when False |
| FillR, FillG, FillB | The fill colour components in the range 0 to 1 |
| LineR, LineG, LineB | The outline colour components in the range 0 to 1 |
| LineWidth | The outline width in the current measurement units |
Methods
| SetPoints | Sets the local geometry as X,Y pairs; wsPolygon needs at least 3 points and is closed automatically, wsLine needs exactly 2, wsCurve needs a start point followed by control-control-end triples (1 + 3n points) |
|---|---|
| PointCount | Returns how many X,Y pairs the local point list holds |
Return value
Apply returns the number of pages the watermark was placed on
See also
ApplyWatermark, TPDFlibWatermarkBase, TPDFlibWatermarkShape, TPDFlibCompositeWatermark