GRAPHIC GET PPI statement

Purpose

Retrieve the resolution of the display device, in points per inch.

Syntax

GRAPHIC GET PPI TO ncWidth&, ncHeight&

Remarks

The graphic target must first be selected with GRAPHIC ATTACH.  The resolution is always specified in pixels, regardless of any GRAPHIC SCALE option.  This statement is particularly useful in drawing items such as rulers and graphs to a "representative physical size".  There are 25.4 millimeters per inch, so just divide by 25.4 to convert from pixels per inch to pixels per millimeter.

"Representative physical size" means that the actual image may be close to a particular physical size, but is subject to factors including Windows default PPI setting, the driver's DPI to PPI ratio and even how the monitor has been adjusted.  By using the GRAPHIC GET PPI, results, you can construct a representative graphic image that can be saved and later output at the intended scale by more precise means, for example a higher resolution Windows printer.

See also

GRAPHIC ATTACH