HP IBASIC Supplement 7-11
Graphics and Display Techniques
Using Graphics
Using Graphics
IBASIC graphics commands are easy to understand and use. You can use
the MOVE statement to move the “pen” to a specific pixel location (without
drawing) and then draw a line from the current pen location to another
pixel coordinate using the DRAW statement. The GCLEAR statement
removes all graphics.
The PEN command provides an easy method of erasing lines drawn by
the DRAW command. When PEN 1 is issued (the default state), all DRAW
commands act normally, drawing a line with the full intensity. When PEN
0 is issued, all DRAW commands erase any pixels their path encounters.
Where there are no lines in the path, no change is visible. As an example
of using the MOVE and DRAW commands, the following statement moves
the logical pen to a point 100 units to the right of, and 150 units above,
the lower left corner of the display:
100 MOVE 100,150
This statement then draws a line to coordinates (200,10):
110 DRAW 200,10
Finally, these two statements erase the previously drawn line:
120 PEN 0
130 DRAW 100,150
Although text and graphics appear together, you can clear them
separately. Use CLEAR SCREEN to clear the text. Use GCLEAR to clear the
graphics.