Device unit for drawing operations (sys.Unit)ΒΆ

sys.Unit,,r8

Device unit for drawing operations

This variable sets the unit used to measure length and position for drawing operations. If it is zero, device units are used. If it is set to a non-zero value, that value is the required unit in inches.

The following useful values for sys.Unit are defined in $SCULPTOR/include/draw.h:

UNIT_DEV

0

device units (the default)

UNIT_CMS

0.3937

centimetres

UNIT_INS

1

inches

By default, the unit used by draw functions is the pixel when drawing in a window, and the conceptually equivalent print unit when drawing on a printer.

When sys.Unit is set, all drawing functions use the unit specified. Fixed length units, such as centimetres, are useful for printouts, but it is recommended that device units are used when drawing in a window, so that the drawing is correctly scaled to the resolution of the screen.

It is recommended that sys.Unit be set to UNIT_CMS or UNIT_INS , and not to UNIT_DEV, when drawing lines and other shapes on a printer. If device units are used, then, for example, a line that is 400 device units long will turn out 2 inches long on a printer whose resolution is 200 dots per inch, but 4 inches long on a printer whose resolution is 100 dots per inch. See Device unit.

Note that sys.Unit must be set to UNIT_DEV if the getprintxy() and setprintxy() functions are to work correctly.


RELATED TOPICS

Drawing operations