Star Micronics SR-10/I5 user manual n Specifying the number of columns of dots

Models: SR-10/I5

1 130
Download 130 pages 19.46 Kb
Page 114
Image 114
nSpecifying the number of columns of dots

(if you’re not sure which type of interface your computer has, check the appendix for your computer).

So when do you use graphics and when do you use download characters? Practically anything you can do with graphics you can do with download characters, and vice versa. A clever pro- grammer could actually plot a mathematical curve using down- load characters or use strings of graphics data as user-defined characters. But why do it the hard way? There are several in- stances when dot graphics is clearly the best way to approach the problem:

If the graphic image to be printed is wider than 11 dots or higher than 8 dots

If an image is to be printed just one time, as opposed to a frequently used “text” character

If you want higher resolution (SR-lo/15 can print as many as 240 dots per inch in dot graphics mode; text mode, which includes download characters, prints 60 dots per inch)

USING THE DOT GRAPHICS COMMANDS

The command to print normal density (60 dots per inch hor- izontal; 72 dots per inch vertical) dot graphics uses this format:

<ESC> “K” nl n2 ml m2 .....

Just like many of the other codes you have learned, the com- mand starts with an escape sequence ( < ESC > “K” in this case). But unlike SR-10/15’s other codes there can be any number of

graphics data bytes following the command. That’s where nl and - n2 come in; they are used to tell SR- lo/15 how many bytes of graphics data to expect.

nSpecifying the number of columns of dots

To figure the values of nl and n2, you’ll need to figure out how wide your graphic image will be (remember that there are 60 columns of dots per inch in normal density). Then comes the fun part: converting one number (the number of columns of dots) into two! Why is it necessary to use two numbers to tell SR-lo/15 the number of graphics codes to expect? Because the largest number we can send in one byte (that’s what the BASIC CHR$() function sends: one byte) is 255. And with normal density graphics

104

Page 114
Image 114
Star Micronics SR-10/I5 user manual n Specifying the number of columns of dots