PDFium Delphi Component 文件

PixelsToInches 函式

元件: TPdf  ·  單元: PDFium
將指定 DPI 下的像素量測值轉換為英吋

Syntax

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

Description

在像素 / 點 / 英吋單位之間轉換量測值的靜態輔助函式。PDF 座標以點表示(1 pt = 1/72 英吋)

將指定 DPI 下的像素量測值轉換為英吋。轉換公式為 value / DPI

這些輔助函式是類別函式;您可以在不具現化 TPdf 的情況下呼叫它們(例如 TPdf.PixelsToInches(96))

Remarks

Example

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

See Also

PixelsToPoints, PointsToInches, PointsToPixels