Programming
36
TTPM3 Printer/Encoder–Technical Manual
0705
4.6.5 Graphics
printing
!F G
21 46 20 47 20 n1...n8
Hex
33 70 32 71 32 n1...n8 Decimal
Format graphics for printing
TTPM3 can print bit map graphics. Graphic images are stored in the fixed memory area
and will therefore be repeated on every ticket until the next !C command is received.
Remember, when creating graphics for the TTPM3 printer, that the pixels are not square
but have a height/width ratio of 1.32:1 or 0.88:1 depending on resolution setting.
Syntax for defining and downloading graphics data is as follows:
!F G <orientation> <xpos> <ypos> 1 <height> <width> 1_<Graphic_data>
!F
Command to load print-parameter information.
G
Indicates graphics mode.
<orientation>
Print orientation. This is ignored in graphics mode. Orientation is
always North (N). The printer requires the N to be inserted.
xpos
Horisontal starting position in pixels for the upper left-hand corner of
the graphics block. Position will automatically be rounded off to be
divisible by 8 as a graphic block has to start at the first bit in a byte.
ypos
Vertical starting position in pixels for the upper left corner of the
graphics block.
1
Not used for graphics printing. Must be set to 1.
height
Height in pixel lines of the graphic block. The length of the ticket
determines maximum height. For an 86 mm ticket the maximum
height is approximately 500 pixel-lines.
width Width
in bytes
of the graphic block. Maximum width is 48
bytes
.
1
Not used for graphics printing. Must be set to 1.
space
One space has to follow the "1" before the graphics data.
Graphic_data
This is a block of bit mapped graphics data. The block is stored in the
printer starting at <xpos>, <ypos>. The numbers of bytes specified by
<width> are stored in one pixel line. The <ypos> is then incremented
and the next line is stored. This is repeated <height> number of times.
It is up to the user to send the correct number of bytes to the printer,
that is, <height> × <width>, as the printer will scan the input character
stream for the correct number of bytes.