libqrencode を使用してQRコードを作成・表示してみるサンプルです。実行に qrcodelib.dll が必要です。
libqrencode を使用してQRコードを作成・表示してみるサンプルです。実行に qrcodelib.dll が必要です。
#uselib "qrcodelib.dll"#func QRcode_encodeString "QRcode_encodeString" str,int,int,int,int#func QRcode_free "QRcode_free" int// 使用ライブラリ// libqrencode// http://fukuchi.org/works/qrencode/index.html// 入手先(Win32バイナリ)// qrencode-win32 qrcode-win32-3.1.1.zip を解凍した先のDLLフォルダに入ってます// http://code.google.com/p/qrencode-win32/// 参考// http://fukuchi.org/works/qrencode/manual/qrencode_8h.html// QRコード化したいURLをいれるurl = "http://www.tkooler.net/"b = 8 // 倍率ox = 32 // オフセットXoy = 32 // オフセットXQRcode_encodeString url, 0, 3, 3, 0qrcode = statdupptr res, qrcode, 12, 4size = res.1dupptr data, res.2, size*size, 2// QRコードの描画color : redraw 0i = 0 : x = 0repeat sizex = cntrepeat size// クロだった場合if peek(data,i)&1{boxf cnt*b+ox, x*b+oy, cnt*b+b+ox, x*b+b+oy}i++looploopredraw 1// 終わったら解放QRcode_free qrcode