The command to enter
LPRINT CHR$(27);1tKf';CHR$(nZ);CHR$( n2);
In this command, ESC K selects
Column reservation numbers
The graphics command requires more than one number to specify how many columns to reserve because although one line can use thousands of columns, the FX does not use numbers larger than 255 (decimal). Therefore, the graphics mode command uses two numbers for reserving columns.
To figure n1 and n2, divide the total number of columns by 256. The result is n2; the remainder iS n1. Since the command is set up for two numbers, you must supply two numbers even if you need only one.
When you need fewer than 256 columns, just make n1 the number of columns you are reserving and make n2 a zero.
For example, if you wish to send 1632 columns of graphics data, n1 should be 96 and n2 should be 6 because 1632 = 96 + (6 X 256).
Graphics data
After receiving a graphics command such as ESC K n1 n2, the printer prints the number of codes specified by n1 and n2 as graphics data, no matter what codes they are. This means that you must be sure to supply exactly the right amount of graphics data. If you supply too little, the printer stops and waits for more data and seems to be locked. The next data sent will then be printed as graphics, even if it is really text. On the other hand, if you supply too much graphics data, the excess will be printed as regular text.
Graphics programming
Here is an example that shows how a graphics command, column reservation numbers, and data can be used to print a single line of graphics. The example is a BASIC program. You can, of course, use another programming language. The principles are the same.
Using Software and Graphics |