PDFium Delphi Component 文件

PointsToPixels 函式

元件: TPdf  ·  單元: PDFium
將指定 DPI 下的 PDF points 轉換為像素

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