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 打印或生成分辨率高于屏幕的图像导出时很有用

示例

// 渲染 2048x2048 整页渲染的左上角 512x512 图块
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