PDFium Delphi Component 文件

PixelsToPoints 函数

组件: TPdf  ·  单元: PDFium
将指定 DPI 下的像素测量值转换为 PDF 点(1/72 英寸)

Syntax

function PixelsToPoints(Pixels, PixelsPerInch: Double): Double;

Description

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

将给定 DPI 下的像素测量值转换为 PDF 点(1/72 英寸)。转换公式是 value * 72 / DPI

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

Remarks

Example

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

See Also

PixelsToInches, PointsToInches, PointsToPixels