D028868 CR1500 CR1100 CR2700 JavaScript Programming Guide User Manual Page 18 of 41
The Code Corporation
12393 South Gateway Park Place, Suite 600, Draper, UT 84020
+1 (801) 495-2200
FAX +1 (801) 495-0280
decodes[i].x
The decode.x property is a read-only property that defines the horizontal position, in
pixels, of the barcode that was just decoded, in relation to the entire image captured by the
reader and analyzed by the decode engine. The value for decode.x can be positive or
negative, based on the fact that 0 is the center of the image.
Example:
var hPos = decodes[i].x;
decodes[i].y
The decode.y property is a read-only property that defines the vertical position, in pixels,
of the barcode that was just decoded, in relation to the entire image captured by the reader
and analyzed by the decode engine. The value for decode.y can be positive or negative,
based on the fact that 0 is the center of the image.
Example:
var vPos = decodes[i].y;
decodes[i].bounds
The bounds property is an array of four sets of x- and y-coordinates that give information
about the position of the last decoded barcode. The four points (x, y) indicate the position in
pixels of the four corners of the barcode from the upper left (0, 0) position in the captured
image as integers. Be aware, in some readers the image is rotated 90°, when displayed in
CortexTools.
//The x and y coordinates of the top right corner of the barcode in the image:
pos.tR = (decode.bounds[0].x, decode.bounds[0].y)
//The x and y coordinates of the top left corner of the barcode in the image:
pos.tL = (decode.bounds[1].x, decode.bounds[1].y)
//The x and y coordinates of the bottom left corner of the barcode in the image:
pos.bL = (decode.bounds[2].x, decode.bounds[2].y)
//The x and y coordinates of the bottom right corner of the barcode in the image:
pos.bR = (decode.bounds[3].x, decode.bounds[3].y)
decodes[i].time
The decode.time property is a read-only property that defines the amount of time, in
milliseconds, it took the decode engine to decode the barcode that was just analyzed.
Example:
var decTime = decodes[i].time;