PDFium Delphi Component 文件

PointsToPixels 函数

组件: TPdf  ·  单元: PDFium
将 PDF 点按指定 DPI 转换为像素

Syntax

function PointsToPixels(Points: Double; PixelsPerInch: Double): Double;

Description

在像素 / 点 / 英寸单位之间转换测量值的静态辅助函数。PDF 坐标以点(1 pt = 1/72 英寸)表示

将 PDF 点按给定 DPI 转换为像素。转换公式是 Round(value * DPI / 72)

这些辅助函数是类函数;你可以在不实例化 TPdf 的情况下调用它们(例如 TPdf.PointsToPixels(96))

Remarks

Example

var
  Margin: Double;
begin
  Margin := TPdf.PointsToPixels(300);
  Memo1.Lines.Add(Format('PointsToPixels(300) = %.4f', [Margin]));
end;

See Also

PixelsToInches, PixelsToPoints, PointsToInches