graphic function ttg_qrcode()

The function ttg_qrcode() creates a QR-Code from a string. Please use the form M_QRCODE (QR-code icon from the toolbar) to generate the QR-code you want. The button Clipboard copies a ttg_qrsetparam() command corresponding to the settings of this form, to be pasted into your T&T Grafic programm. If you generate more than one QR-code with the same setting, the ttg_qrsetparam() is needed only once. Since this function generates a bitmap and returns a string including width and height of the bitmap.
If you want to copy an icon into a QR-Code, see ttg_qrcompare().
Parameters:
1: Text to be converted to QR-code2: Name of the resulting bitmap (fullpath)
***************************** | |
* Tool&Task example program * | |
* ttg_qrcode() * | |
* last compile: 12.07.2022 * | |
***************************** |
local lretval, lfile, lwidth | |
thelink = "HTTPS://WWW.DER-SCRAPBOOK-LADEN.DE" | |
ttg_qrsetparam(0, 0, 1, 3, 4, BLACK, WHITE, 4) | |
lfile = gUserDataTT + "temp\myqr.bmp" | |
lretval = ttg_qrcode(thelink, lfile) | |
lwidth = get_x(lretval) |
&& gets width from lretval |
ttg_new() | |
ttg_createbmp(148,148,FORMCOLOR) | |
ttg_insertbmp(int((148-lwidth)/2), int((148-lwidth)/2), lfile) | |