87
Chapter 4 ePOS-Print API
4
addImage method
Adds raster image printing to the command buffer.
Prints graphics rendered in HTML5 Canvas.
Converts the specified range in a RGBA full-color image of HTML5 Canvas into raster image data according
to the settings of the halftone and brightness properties. One pixel in an image equals to one printer dot.
When an image contains any transparent color, the background color of the image is assumed to be white.
Syntax
addImage
(context, x, y, width, height, color, mode);
Parameter
context
:
(
Required
parameter,
Object
type
:
Context)
Specifies
the
2D
context
of
HTML5
Canvas.
x
:
(
Required
parameter,
Object
type
:
Number)
Specifies
the
horizontal
start
position
in
the
area.
Specifies
an
integer
from
0
to
65535.
y
:
(
Required
parameter,
Object
type
:
Number)
Specifies
the
vertical
start
position
in
the
area.
Specifies
an
integer
from
0
to
65535.
width
:
(
Required
parameter,
Object
type
:
Number)
Specifies
the
width
of
the
area.
Specifies
an
integer
from
0
to
65535.
height
:
(
Required
parameter,
Object
type
:
Number)
Specifies
the
height
of
the
area.
Specifies
an
integer
from
0
to
65535.
color
:
(
Optional
parameter,
Object
type
:
String)
Specifies
the
color.
If
an
HTML5
Canvas
image
contains
images
downloaded
from
different
domains,
you
cannot
the
image.
In
this
case,
a
security
error
occurs
due
to
violation
of
the
same
origin
policy
of
JavaScript.
• To
a
raster
image
at
high
speed,
specify
ALIGN_LEFT
for
the
addTextAlign
method
and
specify
a
multiple
of
8
not
exceeding
the
printer
ʹ
s
paper
width
for
the
width
parameter
of
this
API.
• In
page
mode,
a
raster
image
is
laid
out
in
the
current
position
with
the
reference
point
being
its
bottom
left
dot.
The
position
will
not
move.
• Multiple
tone
printing
is
not
supported
in
Page
Mode.
Multiple
tone
graphic
printing
is
supported
in
Standard
Mode
only.
Setting
Description
COLOR_NONE
Characters are not printed.
COLOR_1 (default)
First color
COLOR_2
Second color
COLOR_3
Third color
COLOR_4
Fourth color
undefined
(When not specified)
First color
Summary of Contents for TM-T88V-i
Page 10: ...10 ...
Page 14: ...14 ePOS Print Canvas API Monochrome or Grayscale Monochrome ...
Page 160: ...160 ...
Page 258: ...258 ...