For now I'm on IDE on macOS Mojave 10.14 & LC 9.5.1
My card has on button with mouseUp script and one image named "img1"
Code: Select all
on mouseUp
put "M" into tECC
put 3 into tSize
put "132" into tData
-- example how to use qrCreate with LiveCode server
qrCreate "!", tData, tECC, tSize
put the result into tData
answer tData
if tData begins with "Error" then
put tData
answer "Error:" && tData
else
# line 1 of the result contains some info
# the remaining lines contain the png image data
put line 1 of tData into tInfo
delete line 1 of tData
put "<b>Qr code info</b><br/>" & LF
put "Version: " & item 1 of tInfo & "<br/>" & LF
put "ECC: " & item 2 of tInfo & "<br/>" & LF
put "Mode: " & item 3 of tInfo & "<br/>" & LF
put "Mask: " & item 4 of tInfo & "<br/>" & LF
# show the image
put base64Encode(tData) into tData
replace LF with empty in tData
put "<img src='data:image/png;base64," & tData & "'/><br/>" & LF into img "img1"
end if
end mouseUp