PDFium Delphi Component 文件

PixelsToPoints 函式

元件: TPdf  ·  單元: PDFium
將指定 DPI 下的像素量測值轉換為 PDF points(1/72 inch)

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