BugFix

QR Code Creator ( based on script by rossati )

19 posts in this topic

Inspired by i've made a little tool for simply QR-Code creation with all required stuff in the au3-file (dll included as binary string, because that, the au3 has 447kB and can not attached directly).

By testing on my system the max. possible count of chars to encode are: $__QR_MAX_LEN = 3049. But on other systems it was round 2000 chars.

Also on another computer the creation of QR-Code fails generally. But ist was the same system that i have (Win 7, 64 bit). I do not know the reason for this behavior.

Would be interesting, how this script runs on other machines.

You can store the QR-Image as *.png and/or *.bmp and/or copy it to clipboard.

Here you can download QR_Creator.au3

Have a look:

post-8176-0-90656400-1356088520_thumb.pn post-8176-0-97725000-1356088533_thumb.pn post-8176-0-09117200-1356088655_thumb.gi

4 people like this

Best Regards BugFix  

Share this post


Link to post
Share on other sites



I get an error on line 320 with $return[0] not actually being an array.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

I get an error on line 320 with $return[0] not actually being an array.

OK, that means, that the dll-call has failed. I've added an failure handling that gives a message with the detected error from dll call. Also I've changed the dll using - instead file name, call with dll handle. Please try again.

Best Regards BugFix  

Share this post


Link to post
Share on other sites

I worked it out the second I posted that bug report. Add the following to the top of the script.

#AutoIt3Wrapper_UseX64=N

Also you don't need #include-once as this isn't a UDF.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Thanks for your efforts. I have included your advice now.


Best Regards BugFix  

Share this post


Link to post
Share on other sites

Looks really nice :), downloaded your version and the source for the dll and took a look....

Maybe better use the unicode functions

DllCall($hDll, "none", "GeneratePNGW", "wstr", $sPath & $_sImageName & ".png", "wstr", $_sText, "int", 4, "int", 2)

GeneratePNGW(LPWSTR fileName, LPWSTR text, int Margin, int PixelSize, QRecLevel level);

Did not find out though how to set last (optional) parameter TErrorCorretion which defaults to 0:

Global Const $QR_ECLEVEL_L = 0 ; lowest

Global Const $QR_ECLEVEL_M = 1

Global Const $QR_ECLEVEL_Q = 2

Global Const $QR_ECLEVEL_H = 3 ; highest

Also there's a function called "DestroyBuffer", maybe a good idea to call before returning? No quite sure though :whistle:...

DllCall($hDll, "none", "DestroyBuffer")

at least does not crash the script :lol:...

; qrencode.h - "Otherwise, all of non-alphanumeric characters are encoded as 8 bit data."

; http://en.wikipedia.org/wiki/QR_code#Storage

; max. characters = 2,953

; possible characters, default encoding = ISO 8859-1

Share this post


Link to post
Share on other sites

Thanks for your reply. Now I have something to do during the Christmas season. :rolleyes:


Best Regards BugFix  

Share this post


Link to post
Share on other sites

Here my results:

The parameter for ErrorCorrectionLevel is only available in the quiricol64.dll. It makes no sense to me to use features that are not run under 32-bit. Therefore, I will omit this parameter.

The function DestroyBuffer() is only needed for GetPNGW() / GetPNGA(). After call, the last parameter in this function contains the pointer to a buffer.

(Thanks to Andy for his testing.)


Best Regards BugFix  

Share this post


Link to post
Share on other sites

Hi BugFix

It´s working like a charm for me (win7 64 bits). It´s very fast..... thanks for sharing.

But about reading qr-codes, do you hav any idea if it could be done in AU3?

I mean, give it an image your software generated to interpret?

I got a program, it reads perfectly your images (only do not read special chars like á, ã, etc.). But I think it´s a problem of that program.

Thanks

Jose

Share this post


Link to post
Share on other sites

Hi BugFix

It´s working like a charm for me (win7 64 bits). It´s very fast..... thanks for sharing.

But about reading qr-codes, do you hav any idea if it could be done in AU3?

I mean, give it an image your software generated to interpret?

I got a program, it reads perfectly your images (only do not read special chars like á, ã, etc.). But I think it´s a problem of that program.

Thanks

Jose

Take a look at this site: http://qrcode.sourceforge.jp/, may be that it helps.

Best Regards BugFix  

Share this post


Link to post
Share on other sites

This is pretty cool, but I'm trying to figure out just what to enter in the QR code. I got my phone to read plain text that I've created and to go to a web link by just entering the http:// stuff. But I've been looking for a while on the web for guidance about what goes into the code for other functions without much luck so far. Specifically, what's the syntax (as it relates to your script) for the various functions like what's needed to have it generate a vCard or meCard, or to automatically dial a phone number. Can you recommend any sites that have this kind of info?

Share this post


Link to post
Share on other sites

Try just entering a phone number for the code. My phone app prompts me to dial the phone number, when I scan a code with a phone number in it.

Try this page for an example

http://yourfreeqrcode.com/phone.php


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

This is a way cool program but i have a question.........

I don't have any experience what so ever with scripting but i could use the qr creator as a part of a filemaker database i am developing for the last 2 years to generate te qr code for phone numbers, can somebody tel me if the qr code generator accepts command line parameters? and so what is the syntax, I would like to generate the code from filemaker and paste it back into filemaker without an intermediate step so fully automated.

And if it doesnt accept command line parameters maybe someone can adapt it so that is does.

thank you for your effort.

Sorry for my bad english ( im dutch so please foregive me )

Share this post


Link to post
Share on other sites

As commandline tool try this version (not tested).

#AutoIt3Wrapper_UseX64=N

; == Syntax: "QR_Creator_CmdLine.exe sOutputPath.type sText"
; == i.e.: '"C:\Program Files (x86)\QR_Creator_CmdLine.exe" "C:\Users\USER\QR_new.bmp" "Text to encode"' -- output type *.bmp or *.png

If $CmdLine[0] <> 2 Then Exit

OnAutoItExitRegister("_DelBinaryTempFiles")
Global $sDllQR = @ScriptDir & "\quricol32.dll"
_CreateDll()

Func _CreateDll()
Local $bData
; string with binary data from: quricol32.dll
$bData &= "0x4D5A90000300000004000000FFFF0000B80000000000000.........."
;....
;...
Local $hFileOut = FileOpen($sDllQR, 2+8+16)
FileWrite($hFileOut, Binary($bData))
FileClose($hFileOut)
EndFunc

Func _DelBinaryTempFiles()
If FileExists($sDllQR) Then FileDelete($sDllQR)
EndFunc


Global $sPathOut = $CmdLine[1], $sType = StringRight($sPathOut, 3), $sText = $CmdLine[2]
Global $hDll = DllOpen($sDllQR)

If $sType = 'bmp' Then
DllCall($hDll, "none", "GenerateBMPW", "str", $sPathOut, "str", $sText, "int", 4, "int", 2)
Else
DllCall($hDll, "none", "GeneratePNGW", "str", $sPathOut, "str", $sText, "int", 4, "int", 2)
EndIf
DllClose($hDll)

Best Regards BugFix  

Share this post


Link to post
Share on other sites

I know this is a bit old. But I wanted to utilize QR in a program I'm going to attempt to create. Now the creation I can do through AutoIt through this script (Thanks for that!)

But I would also like to be able to decode the same image in AutoIt. But I'm not sure how to do that ^^; Anyone got some tips or already done this? Thanks!


MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Share this post


Link to post
Share on other sites

from some time, an error occur: "_WinAPI_CopyImage, duplicate function name".

What is changed?

Now the function "_WinAPI_CopyImage" is in WinAPIGdi.au3, included in GDIPlus.au3, included in QR_Creator.au3.

Before?


Adams

Share this post


Link to post
Share on other sites

That's great ! I was looking for this for Eon :)

Share this post


Link to post
Share on other sites

#19 ·  Posted

Works like a charm :)

I found this scanner produced best results - including returning plain text https://www.scan.me/


Skysnake

Why is the snake in the sky?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now