7-10 HP IBASIC Supplement
Graphics and Display Techniques
Displaying Text
Graphics Initialization and Scaling
In all partitions, display coordinate 0,0 is at the bottom left corner and
the image is cropped to fit the display if the X,Y coordinate exceeds the
displayable range of the current partition. Figure 7-4 shows the different
partitions and the pixel dimensions (GESCAPE values) for each.
After a GINIT command, the display is dimensioned as 100 GDUs
(Graphical Display Units) high and 122 GDUs wide (assuming a full
partition). This gives a RATIO (aspect ratio) result of 1.22 and provides
the same results as issuing a WINDOW 0,122,0,100 command. To
prevent circles from appearing oval in shape, this ratio should be
maintained. You can also issue a WINDOW 0,537,0,439 command. This
will maintain the same ratio but the display will now be dimensioned in
actual pixel units. This may be more useful than the default GINIT
values since fractional display units are not needed; it allows integers
only to be used, thus speeding execution. These are also the same values
that are returned by using the GESCAPE command (see BARCODE
program example). The GESCAPE command will always set the current
pixel dimension sizes. Because the results of this command can vary
drastically with partition size, you must first partition the display before
executing the GINIT and GESCAPE commands.
NOTE Upon power up, the default display coordinates are 0,537,0,439 and
will remain that until a GINIT is performed. It is recommended that a
GINIT command always be part of any graphics program and that it be
executed only after the display partition is set.
Figure 7-4 Pixel Dimensions with Available Display Partitions