PDFium Delphi Component Docs

TPdf.PixelsToInches 函式

單元: PDFium
把指定 DPI 下的像素量測值轉換為英吋

語法

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

說明

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

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

PDFium 單元的單元層級輔助函式;不必具現化 TPdf 即可呼叫(例如 PixelsToInches(96, 96))

備註

範例

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

另請參閱

PixelsToPoints, PointsToInches, PointsToPixels