The Pts
interface contains utilities to convert between points
and pixels. VBTkit uses 72 points per inch and 25.4 millimeters
per inch.
The locking level is arbitrary for all procedures in this interface.
INTERFACEPts ; IMPORT Axis, VBT; PROCEDURE ToScreenPixels (v: VBT.T; pts: REAL; ax: Axis.T): INTEGER;
Return the number of screen pixels that correspond topts
points onv
's screentype in the axisax
; or return0
ifv
's screentype isNIL
. Equivalent toROUND (ToPixels (v, pts, ax))
PROCEDURE ToPixels (v: VBT.T; pts: REAL; ax: Axis.T): REAL;
Return the number of pixels that correspond topts
points onv
's screentype in the axisax
; or return0
ifv
's screentype isNIL
.
PROCEDURE FromPixels (v: VBT.T; pixels: REAL; ax: Axis.T): REAL;
Return the number of points that correspond topixels
pixels onv
's screentype in the axisax
; or return0
ifv
's screentype isNIL
.
CONST PtsPerInch = 72.0; MMPerInch = 25.4; PROCEDURE FromMM (mm: REAL): REAL;
Convert from millimeters to points.
PROCEDURE ToMM (pts: REAL): REAL;
Convert from points to millimeters.
END Pts.