The graphics command format
There are several different graphics commands giving different horizontal dot densities and printing speeds. Because the format is almost the same for all the commands, however, the example here keeps things simple by using only the
The command to enter
LPRINT CHR$(27);"K";CHR$(n1);CHR$(n2);
ESC K specifies
Column reservation numbers
Even in
Because the commands are set up for two numbers, you must supply two even if you need only one. When you need fewer than 256 columns, it is easy to determine n1 and n2: n1 is the number of columns you are reserving and n2 is zero. For example, to send data for 200 columns of graphics, n1 is 200 and n2 is 0.
For more than 256 columns of graphics data, n2 is the number of complete groups of 256 columns, and n1 is the number of columns to complete the line. For example, to send 1632 columns of graphic data, nl is 96 and n2 is 6 because 96 + (6 x 256) = 1632.
You can calculate both nl and n2 by dividing the total number of columns by 256. The quotient is n2 and the remainder is nl. If you are using a programming language with MOD (modulus) and INT (integer) functions, you can use the following formulas, in which n is the total number of columns.
nl = n MOD 256 n2 = INT (n/256)
Introduction to Dot Graphics | 6.5 |