AN-04 (LP)
September 23, 2005
HOW TO PRINT BITMAP GRAPHICS IN LINE PRINTER MODE
This document describes how to print bitmapped graphics in Line Printer mode. Two other graphics mode are
available. One is RLE compressed graphics (see AN-05) and downloaded .PCX graphics printed from Easy Print (see
AN-09).
Using the ESC V n1n2 <data> to send graphics to be printed one
virtually identical to the way most graphic commands have worked on many different printers for years. It is used to
print a bitmap graphic on the fly, where the image is to be printed once and then discarded rather than to be stored and
printed again and again. The ESC V n1n2 precedes the actual bitmap data that forms the picture. The ESC V tells the
printer to enter a graphics mode, the n1n2 tells the printer how tall the graphics image is.
A bit map graphic is an image composed of individual bits in bytes, each bit rep
the image, and the bytes laid end to end from left to right, then stacked, making up the image a series of very thin strips
going across the image from left to right and from top to bottom.
For example, if you look at the image bel
imagination), composed of individual pixels each the size of one letter. We’ll let a space represent a white pixel, and an
X represent a black pixel:
ow, you can see a diamond with a rectangle inside (you might need a little
XXXX
XXXXXXXX
XX XX
XX XXXX XX
XX XXXX XX
XX XXXX XX
XX XXXX XX
XX XXXX XX
XX XX
XXXXXXXX
XXXX
time (and not stored) is really extremely simple, and is
resenting a pixel (or picture element) in
To form this image digitally, we would make the black pixels (represented by X’s) a ONE bit and the white areas
a ZERO bit:
000000000011110000000000
000000001111111100000000
000000011000000110000000
000000110011110011000000
000001100011110001100000
000011000011110000110000
000001101011110001100000
000000110011110011000000
000000011000000110000000
000000001111111100000000
000000000011110000000000
Now we can separate these out into bytes with each byte representing 8 bits, or pixels. This would be a true binary
representation of the bitmap of our image.
00000000 00111100 00000000
00000000 11111111 00000000
00000001 10000001 10000000
00000011 00111100 11000000
00000110 00111100 01100000
00001100 00111100 00110000
00000110 00111100 01100000
00000011 00111100 11000000
00000001 10000001 10000000
00000000 11111111 00000000
00000000 00111100 00000000
Since most programmers do not work in Binary, we’ll convert the binary image into HEX;
0x00 0x3C 0x00
0x00 0xFF 0x00
0x01 0x81 0x80
0x03 0x3C 0xC0
0x06 0x3C 0x60
0x0C 0x3C 0x30
0x06 0x3C 0x60
0x01 0x81 0x80
0x00 0xFF 0x00
0x00 0x3C 0x00