PDFium Delphi Component 文件

OnFormSelectionRect 事件

元件: TPdf  ·  單元: PDFium
表單層每回報一個選取矩形就引發一次

Syntax

property OnFormSelectionRect: TPdfFormSelectionRectEvent read FOnFormSelectionRect write FOnFormSelectionRect;

Description

OnFormSelectionRect 對焦點欄位的每個相異選取矩形各引發一次。處理常式會收到一個 TPdfFormSelectionRect,內含以 1 為基底的 PageNumber 與頁面空間座標的 Bounds

連續的重複項會被抑制;每個回報的矩形也會附加到 FormSelectionRects 公開的清單

Remarks

    • 處理常式簽名:procedure(Sender: TObject; const SelectionRect: TPdfFormSelectionRect) of object
    • 即時覆蓋層繪製請使用此即時事件,批次重繪則使用 FormSelectionRects
    • 焦點移到其他欄位時,請呼叫 ClearFormSelectionRects

Example

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

See Also