PDFium Delphi Component Docs

RenderTile 方法

元件: TPdfView  ·  單元: PDFium
將頁面的矩形區域繪製到新的點陣圖。傳回的點陣圖必須手動釋放

語法

function RenderTile(Left, Top, Width, Height, PageWidth, PageHeight: Integer; Rotation: TRotation = ro0; Options: TRenderOptions = []): TBitmap;

RotationTRotation. 算繪圖塊時套用的順時針旋轉:ro0、ro90、ro180 或 ro270
OptionsTRenderOptions. 控制註解可見性、LCD 文字等的算繪旗標集合

 

procedure RenderTile(Bitmap: TBitmap; Left, Top, Width, Height, PageWidth, PageHeight: Integer; Rotation: TRotation = ro0; Options: TRenderOptions = []);

BitmapTBitmap. 用於算繪圖塊的既有點陣圖
RotationTRotation. 算繪時套用的順時針旋轉
OptionsTRenderOptions. 算繪旗標集合

說明

將目前頁面的矩形圖塊算繪到點陣圖。Left、Top、Width 與 Height 定義虛擬全頁算繪(大小為 PageWidth × PageHeight 像素)內的圖塊區域。如此便能以較小且節省記憶體的圖塊,對大型頁面進行高解析度算繪

函式多載會配置新的 TBitmap,必須由呼叫端釋放。程序多載則算繪到既有的點陣圖。此方法適用於高 DPI 列印,或產生解析度高於螢幕的影像匯出

範例

// Render the top-left 512x512 tile of a 2048x2048 full-page render
var Bmp: TBitmap;
begin
  Bmp := PdfView.RenderTile(0, 0, 512, 512, 2048, 2048);
  try
    Image1.Picture.Assign(Bmp);
  finally
    Bmp.Free;
  end;
end;

另請參閱

TPdfView.RenderPage, TPdfView.Zoom, TPdfView.PageRotation