graphic function ttg_bar_2of5i()
Bar-code 2 of 5 interleaved only codes digits ('0' - '9'). The code for each digit has 5 elements, 2 wide and 2 small ones. It codes pairs of digits where the first is coded as 5 bars and the second as 5 spaces. If the number of digits you provide in the code string is not even, a leading '0' is added automatically. You may add a check-digit for your string. it is returned by getcheck_2of5i(<code string>). In this case the complete sting is transferred to the routine.
(see example). As we experienced, there are bar-code readers which do not read code strings shorter than 6 digits.here is more information about this bar-code: English,German.Parameters:
1: name for bitmap to create2: string of digits to code
***************************** | |
* Tool&Task example program * | |
* ttg_bar_2of5i() * | |
* last compile: 13.07.2022 * | |
***************************** |
ttg_new() | |
ttg_createbmp(148,148, FORMCOLOR) | |
ttg_bcsetparam(2, 2.3, 50, BLACK, WHITE) | |
lxy = ttg_bar_2of5i("123456", gUserDataTT + "temp\topcde.bmp") | |
lwidth = get_x(lxy) | |
ttg_bcsetparam(2, 2.3, 50, BLACK, WHITE) | |
ttg_bar_2of5i("789012", gUserDataTT + "temp\bottcde.bmp") | |
left = (148 - lwidth - 30)/2 |
&& 15 pixels left and right white |
ttg_pen(0, 1, WHITE) |
&& no frame for the white rectangle |
ttg_brush(1, WHITE) |
&& fill rectangle white |
ttg_rectangle(left,6, 148-left, 64) |
&& 4 pixels top and bottom |
ttg_insertbmp(left+15, 10, gUserDataTT + "temp\topcde.bmp") | |
ttg_insertbmp(left+15, 80, gUserDataTT + "temp\bottcde.bmp") | |
ttg_pen() | |