beautypg.com

A simple graphics program, Using hand-calculated, Using hand-calculated data to print graphics – Epson Y465ss127mo User Manual

Page 123: Using software and graphics

background image

A simple graphics program

This first program is just a simple example to show you how the graphics

command, column reservation numbers, and data can be used in a

BASIC program.

Type and run the following program. Be especially careful to include

both semicolons. The program produces the printout you see below it.

WIDTH

255

LPRINT

FOR

TO

LPRINT
NEXT X

Line 20 selects single-density 24-pin graphics mode (mode 32) and also

reserves 40 columns for graphics. Since the 24-pin graphics mode

requires three bytes of data for each column, line 30 begins a loop to

supply 120 bytes of data. Line 40 contains the number 170, which

produces the first pin pattern shown in the section on pin labels, and line

50 finishes the loop.

Using hand-calculated data to print graphics

With what you know now, you can use the simplest application of

graphics-using hand-calculated data to print graphic images. While this

method is tedious, it helps you understand dot graphics. Also, it is useful

for small graphic elements that are used many times.

The following illustration shows how you can use a grid to plan where

you want dots to be printed. This grid is for a single line of graphics 42

columns long. Since each line of 24-pin graphics is approximately l/8th

of an inch high and since triple-density graphics prints 180 dots per inch

horizontally, a design planned on this grid will be about l/8th of an inch

high and less than l/4th of an inch wide.

4-18

Using Software and Graphics