PDFium Delphi Component 文件

OnFormSelectionRect 事件

组件: TPdf  ·  单元: PDFium
表单层报告的每个选择矩形都会触发一次

语法

property OnFormSelectionRect: TPdfFormSelectionRectEvent read FOnFormSelectionRect write FOnFormSelectionRect;

说明

对于表单层为焦点字段报告的每个不同选择矩形,OnFormSelectionRect 都会触发一次。处理器接收一个 TPdfFormSelectionRect,其中含从 1 开始的 PageNumber 和页面空间的 Bounds

连续的重复项会被抑制;每个报告的矩形还会追加到 FormSelectionRects 公开的列表中

备注

    • 处理器签名:procedure(Sender: TObject; const SelectionRect: TPdfFormSelectionRect) of object
    • 用实时事件做即时叠加绘制,用 FormSelectionRects 做批量重绘
    • 当焦点移到其他字段时,请调用 ClearFormSelectionRects

示例

procedure TMain.Pdf1FormSelectionRect(Sender: TObject; const SelectionRect: TPdfFormSelectionRect);
begin
  HighlightSelection(SelectionRect.PageNumber, SelectionRect.Bounds);
end;

参见