PDFiumVCL 文件

PointsToPixels method

此 API 條目保留識別符號、簽名、程式碼塊和 PDF 術語的原始形式。
Component: TPdf  ·  Unit: PDFium
Convert PDF points to pixels at the given DPI.

Syntax

class function PointsToPixels(Points: Double; DPI: Integer = 96): Integer;

Description

Static helper that converts a measurement value between pixel / point / inch units. PDF coordinates are expressed in points (1 pt = 1/72 inch).

Convert PDF points to pixels at the given DPI. The conversion formula is Round(value * DPI / 72).

These helpers are class functions; you can call them without instantiating TPdf (e.g. 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