TPDFlibShapeWatermark
Data types, page layout
描述
TPDFlibShapeWatermark 是 v3.223.0 引入的 TPDFlibWatermarkBase 具象子類別,以填色與線框色、線寬與不透明度把向量圖形蓋印到頁面範圍
矩形、圓或橢圓由 Width 與 Height 決定尺寸;多邊形、貝茲曲線鏈或直線從 SetPoints 設定的點清單取得幾何,座標以圖形左上角為局部原點,因此九點 Position 網格依然適用
語法
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;參數
| Shape | 要繪製的向量圖形,取自 TPDFlibWatermarkShape |
|---|---|
| Width, Height | wsRectangle、wsCircle 與 wsEllipse 使用的外包尺寸 |
| Filled | True 時填色加線框,False 時僅線框 |
| FillR, FillG, FillB | 範圍 0 到 1 的填色分量 |
| LineR, LineG, LineB | 範圍 0 到 1 的線框色分量 |
| LineWidth | 以目前測量單位表示的線框寬度 |
方法
| SetPoints | 以 X,Y 對清單設定局部幾何;wsPolygon 至少 3 個點並自動閉合,wsLine 恰好 2 個點,wsCurve 需要起點加上控制點、控制點、終點的三元組(1 + 3n 個點) |
|---|---|
| PointCount | 回傳局部點清單持有的 X,Y 對數量 |
傳回值
Apply 回傳浮水印落版的頁數
另請參閱
ApplyWatermark, TPDFlibWatermarkBase, TPDFlibWatermarkShape, TPDFlibCompositeWatermark