PDFium Component Docs

Anchors プロパティ

この API エントリでは識別子、シグネチャ、コードブロック、PDF 用語を元の表記のまま保持します。
コンポーネント: TPdfView  ·  ユニット: PDFium
親のサイズが変更されたとき、ビューアーのどの端が親の対応する端から固定距離を保つかを指定します

構文

property Anchors: TAnchors; // published, default [akLeft, akTop]

説明

Anchors are an alternative to Align that give pixel-accurate control over how the PDF viewer follows its parent container. Each element of the set (akLeft, akTop, akRight, akBottom) はビューアーのその端を親の同じ端へ固定します。向かい合う両端が固定されている場合、親のサイズ変更時にビューアーは伸縮します。片側だけが固定されている場合、ビューアーはサイズを保って移動します

The most common layout for a PDF reader inside a fixed-width inspector pane or a wizard step is [akLeft, akTop, akRight, akBottom], which is functionally equivalent to alClient but leaves the design-time bounding rectangle intact and lets you nest other controls around the viewer without z-order surprises.

アンカーによってビューアーが拡大または縮小するたびに、継承された resize ハンドラーがスクロール領域を再計算します。アクティブなFitMode (when not pfmNone) が再適用されるため、ページ描画はビューポートとの視覚的関係を保ちます

備考

// Lock the viewer to all four edges of its parent panel
procedure TForm1.ConfigureViewer;
begin
  PdfView1.Parent := PanelMain;
  PdfView1.Align := alNone;
  PdfView1.SetBounds(8, 8, PanelMain.ClientWidth - 16,
    PanelMain.ClientHeight - 16);
  PdfView1.Anchors := [akLeft, akTop, akRight, akBottom];
  PdfView1.Constraints.MinWidth := 320;
  PdfView1.Constraints.MinHeight := 240;
end;

関連項目

Align, Constraints, OnResize, FitMode