With this UDF you can add the creation of QR codes to your projects with a graphical user interface or via the command line.
It uses the quricol - QRCode generator library by Serhiy Perevoznyk. Therefore, please observe the licence conditions when using it in your projects.
QRCreator.au3 v 0.3
QRCreatorUI.au3 v 0.3
QRCreatorCI.au3 v 0.2
QRCreator.au3 | This is the base UDF that need for all. You can write your own applications by using it. |
QRCreatorUI.au3 | This is the graphical User Interface to deal with all functions of the UDF. As a special feature, you have a preview that can be enlarged. |
QRCreatorCI.au3 | This is the Commandline Interface. With the exception of HBITMAP generation, which is not required on the command line, you can perform all functions of the UDF to generate QR codes. |
_QR_generatePNG | Generates the QR-Code as PNG file for the passed text. |
_QR_generateBMP | Generates the QR-Code as BMP file for the passed text. |
_QR_getHBitmap | Creates a HBITMAP handle for the QR-Code for the passed text. Don't forget to delete it, if no more need (_WinAPI_DeleteObject(HBITMAP)). |
_QR_copyToClipboard | Copies the QR-Code picture for the passed text to the clipboard. |
_QR_FileDefault | Generates a default filename (QR_YYYYMMDD_hhmmss) |
_QR_getLastCall | Asks for the result of the last call (_QR_getHBitmap/_QR_copyToClipboard/_QR_generateBMP/_QR_generatePNG) Gets a structure with: .success(1/0) .error(@error) .width .type(B/C/[F/R]) .output(hBMP/''/fullpath) .margin .sizept .corrlevel Types(.type): B (HBITMAP), C (Clipboard), F (File created), R (resized file created) |
$_sText | The text to encode. Full unicode is supported. |
$_sPathOut | ONLY: _QR_generatePNG und _QR_generateBMP The full path of the file to create. If only a filename has passed the @ScriptDir will used. Without a filename the default filename will used (QR_YYYYMMDD_hhmmss). If the filename exists, it will get a suffix (1..n) until it's unique. |
$_iMargin | The QR-Code margin in pixel. |
$_iSizePt | Size of the points in the QR-Code (1-4, depends by the correction level) If a wrong value is passed, it will corrected by the script. |
$_iCorrLvl | The used correction level (0-3). Allows to read a QR-Code if some parts damaged. |
$_iOutSize | ONLY: _QR_generatePNG und _QR_generateBMP As a new feature you can pass a target size for created file. The size of the file depends by used correction level and the size of created points. If you pass a value for width (and so for heigth too), the default by the dll created file will resized for this size. If the passed size is to small it raises an error. |
$_iScale | ONLY: _QR_copyToClipboard Also new is the ability to scale up the QR-Code copied to clipboard. It's a factor for linear scaling, based on the default creation size by the dll call. |
All information for the actions you've done will shown in the statusbar of the GUI.
But this is my own created statusbar, that allows formatting. I've attached them too.
text | Text for encoding |
file | path/filename[.ext] If ommited, the default will used: @HomeDrive & @HomePath & "\QR_YYYYMMDD_hhmmss" |
type | png,bmp,clip (or combined png/bmp) If ommited, 'png' will used. With clip runs CopyToClipboard. If file has .ext and type is passed but is different to .ext than will used type. |
width | ONLY: File creation Size in pixel, (also used for height) Initializes a resizing of the default created QR-Code. Resizing fails, if passed size is smaller as the default generated file. |
scale | ONLY: CopyToClipboard Factor for up scaling the QR-Code |
margin | The margin around the QR-Code in pixel (Default = 4) |
corrlevel | Up to 7%, 15%, 25% or 30% damage [0, 1, 2, 3]. (Default = 0) |
sizept | The size of the painted pixel itself. The value depends on the correction level. Only the smallest point size can be used for the largest correction level. The value will corrected automatically, if wrong. |
comma separated string with:
ERROR=@error
RESULT='FullFilePath' or 'CLIPBOARD'
SIZE=width x heigth
SIZEPT=The really used (may be corrected) size of point
MARGIN=The used margin size
CORRLEVEL=The used correction level