Device unit for drawing operatiionsΒΆ
Device unit
The device unit is the unit used to measure length and position. All co-ordinates, widths and heights are expressed in device units.
When drawing in a window, the unit is the pixel. When drawing on the printer, Windows uses a conceptually equivalent unit. These units are managed in a device-independent way, being adjusted to the resolution of the device being used. In a report, the current print position in device units can be retrieved by means of the getprintxy() function, enabling draw functions to be accurately positioned amidst Sculptor print[h] commands. When the draw operation is complete, the setprintxy() function is available to set the new print position.
As an alternative to measuring in device units, the Sculptor system variable sys.Unit may be used. Possible values for this variable are defined under Drawing units in $SCULPTOR/include/draw.h.
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.
RELATED TOPICS |