# Barcode Generators

## Recommended Posts

As I have time, I am converting my old barcode generators from old Pascal source to AutoIt.  I will add them all here as I convert them, rather than creating a new topic for each one.

There are no global variables involved, so you can safely include any of these without worry about variables being stomped on.

No barcode fonts required.

Code128AutoCreates a Code128A/B/C optimized barcode from supplied data

Code39Creates a Code39 or Code39Extended (with or without check-character) barcode from supplied data (also known as Code 3 of 9).

CODABAR - Creates a CODABAR barcode from supplied data (used mainly by libraries and blood banks)

NOTE:  These will require the StringSize UDF by Melba23

==========

CodeQR - Creates a QRcode from supplied data.

Edited by willichan
Updated tags

##### Share on other sites

Thanks for sharing.
Generated bmp files looks realy good.

mLipok

ps.
https://www.autoitscript.com/wiki/User_Defined_Functions#Misc

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
*
How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
, be   and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2019-10-01

##### Share on other sites

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

##### Share on other sites

Thank you both.

As soon as I figure out how to put the images on the clipboard without saving to a BMP file first, I will add that to them as well.

##### Share on other sites

Technically, this is just an implementation of a QRcode dll, and several others have posted their own implementations, but I thought it fit well with this collection.

CodeQR.zip

Requires quricol32.dll from http://delphi32.blogspot.it/2011/11/quricol-qr-code-generator-library.html

##### Share on other sites

Added CODABAR for working with libraries and blood banks.

Allows you to select start/stop codes customized to the application.  Recognizes both "ABCD" and "TN*E" notations.

Extended characters (-$:/.+) are supported by the UDF, but most scanners do not support them and get confused when they are used. Edited by willichan typo/spelling #### Share this post ##### Link to post ##### Share on other sites I am using the 128 barcode generator, and it works pretty good. How difficult would it be to refactor the code so you can state an explicit width / height for the image? I gave this a try myself but I don't understand the code enough. I also think I found a bug. I made a few barcodes, using the same number while changing the DPI, but at higher DPI's it starts cutting off the top and bottom of the barcode. Perhaps some math for margins / padding is off? Edited by corgano 0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e #### Share this post ##### Link to post ##### Share on other sites I am using the 128 barcode generator, and it works pretty good. How difficult would it be to refactor the code so you can state an explicit width / height for the image? I gave this a try myself but I don't understand the code enough. I also think I found a bug. I made a few barcodes, using the same number while changing the DPI, but at higher DPI's it starts cutting off the top and bottom of the barcode. Perhaps some math for margins / padding is off? ​You can (sort of) specify a height by setting$fBarHeight.  Width will vary depending on the length of the code.  If you need a specific width/height, you may need to look at resizing the generated BMP, though I would not recommend it, since your bar codes may not be readable after resizing.  These bar code routines adhere to the particular bar code format specifications.  For the Code128 bar codes, I use the GS1-128 specification.

If you need a fixed width bar code (and all of the codes you are encoding are the same length) you might want to use 3of9 instead.

##### Share on other sites

I did a bit of messing about and came up with this. IT basicly lets you set a height, width, font size, and padding, and then will try and make a barcode that fits that.

Func GenerateBarcodeImage($barcodestring,$width, $height,$File = Default, $FontSize = Default,$iPadding = Default, $DPI = Default,$DPIresize = Default)
$bits = __Bcode128_EncodeData($barcodestring)
$bits =$bits[0]

If $DPI = Default then$DPI = 96
If $iPadding = Default then$iPadding = 15
If $DPIresize = Default then$DPIresize = 0
If $FontSize = Default then$FontSize = Ceiling($height/10) If$file = Default then $file = @TempDir&"\LCS\"&$barcodestring&".bmp"
DirCreate(StringLeft($file, StringInStr($file, "\", 0, -1)))

ConsoleWrite($FontSize&@CRLF) Local$iBarHeight = $height -$iPadding*2
If $FontSize > 0 Then$iBarHeight -= $FontSize+2 Local$fMinBar = 0.015 ; of an inch
Local $iBarWidth = Ceiling($DPI * $fMinBar) If$DPIresize Then
For $iBarWidth =$iBarWidth + $DPIresize to$iBarWidth - $DPIresize step -1 If$iBarWidth*StringLen($bits) <=$width Then ExitLoop
If $iBarWidth = 1 then ExitLoop Next EndIf If$iBarWidth*StringLen($bits) >$width Then
ConsoleWrite("Caution: Barcode width ("&$iBarWidth*StringLen($bits)&") is wider than the image width! ("&$width&")"&@CRLF) EndIf #include <GDIPlus.au3> ;;create image _GDIPlus_Startup() Local$hBitmap = _GDIPlus_BitmapCreateFromScan0($width,$height, $GDIP_PXF01INDEXED) __Bcode128_BitmapSetResolution($hBitmap, $DPI,$DPI)

Local $sCLSID = _GDIPlus_EncodersGetCLSID("bmp") Local$hBmpCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hBmpCtxt, 0)
_GDIPlus_GraphicsClear($hBmpCtxt, 0xFFFFFFFF) ;;draw lines For$i = 1 To StringLen($bits) If StringMid($bits, $i, 1) = 1 Then$cx = ($width/2) - (StringLen($bits)*$iBarWidth/2) + (($i-1) * $iBarWidth) _GDIPlus_GraphicsFillRect($hBmpCtxt, $cx,$iPadding, $iBarWidth,$iBarHeight, 0)
If @error Then ConsoleWrite("unable to draw bar " & $i & @CRLF) EndIf Next If$FontSize <> 0 and $barcodestring <> "" Then ;;add text to bottom$i = _StringSize(String($barcodestring),$FontSize, Default, Default, "Arial")
$cx = ($width/2) - ($i[2]*1.16 / 2) _GDIPlus_GraphicsDrawString($hBmpCtxt, $barcodestring,$cx, $iBarHeight +$iPadding, "Arial", $FontSize) If @error Then ConsoleWrite("unable to draw text - " & @extended & @CRLF) EndIf FileDelete($file)
;;save and dispose of image
_GDIPlus_ImageSaveToFile($hBitmap,$file)
If @error Then ConsoleWrite("unable to write to file" & $file & @CRLF) _GDIPlus_GraphicsDispose($hBmpCtxt)

##### Share on other sites

Maybe the poster doesn't use an up-to-date version of AutoIt.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

##### Share on other sites

I'm on SciTe Version 3.4.4  and Auoit 3.3.12 on a Windows 7 SP1 x64

I'll try to make some more test with other computers during the weekend.

By the way I can not stop thanking you for the QR code generator.

EDIT:

Sorry for any incovenience. I has copied the old Include folder over the new one after the installation.

Now your examples do work like a charm. Unfortunately now I need to find a work around for some script breaking changes

Thanks a lot.

Greets from Barcelona

Edited by Qwerty212
problem solved

##### Share on other sites

Code39, Code128Auto and CodeCODABAR have been updated.

Fixed issue where a blank label area was still created, even if the no label option was selected.

Support for copying the barcode to the clipboard instead of saving to a file has been added.

##### Share on other sites

Wow I searched for "AutoIT QRCode" and never found this instead I found a much older UDF from 2012 that was not very good.

I continued my search and finally found the cmd driven QRCode generator that the .dll is based on and write an entire GUI based around using that .exe

Wonder if it is worth moving to your UDF and using the DLL instead, the only real difference other than having a native UDF vs using a CMD @COMSPEC is that the UDF produces a .bmp while the .exe produces a .png

Also there is a new version of the DLL if you wanted to add any features to the UDF:

http://delphi32.blogspot.com/2013/09/quricol-20-qr-code-generator.html?_sm_au_=iQVPpLsPC546MqkP

My "Wrapper" for qrcode.exe

The Manufacture Date stuff is based on HP computers where the date is part of the serial number, but this was just something I put together so we can barcode our computers quickly.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <CompInfo.au3>
#Include <Date.au3>
#Include <File.au3>

If NOT FileExists(@ScriptDir & "\QRCode.exe") Then
MsgBox(0, "Black Magic Automation", "QRCode.exe is missing and required, please move to same directory and retry.")
Exit
EndIf

#Region ### START Koda GUI section ### Form=c:\users\it022565\desktop\auto barcode\form1.kxf
$Form1_1 = GUICreate("Black Magic Automation QR Code Generator", 488, 485, 244, 163)$Edit1 = GUICtrlCreateEdit("", 24, 344, 273, 129, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN)) GUICtrlSetData(-1, "Press Update Barcode Info")$ModSize = GUICtrlCreateInput("ModSize", 40, 65, 121, 21)
$MarginSize = GUICtrlCreateInput("MarginSize", 192, 65, 121, 21)$Radio1 = GUICtrlCreateRadio("Low", 352, 64, 113, 17)
$Radio2 = GUICtrlCreateRadio("Medium", 352, 80, 113, 17)$Radio3 = GUICtrlCreateRadio("Quartile", 352, 96, 113, 17)
$Radio4 = GUICtrlCreateRadio("High", 352, 112, 113, 17)$Label1 = GUICtrlCreateLabel("Automatic Computer Barcode Generator", 88, 0, 327, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("Module Size (Pixels)", 56, 48, 98, 17)$Label3 = GUICtrlCreateLabel("Margin Size (Pixels)", 208, 48, 95, 17)
$Label4 = GUICtrlCreateLabel("Error Correction", 352, 48, 77, 17)$Button1 = GUICtrlCreateButton("Generate!", 336, 360, 123, 89)
$Label5 = GUICtrlCreateLabel("QR Settings", 200, 32, 72, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")$Label6 = GUICtrlCreateLabel("Computer Data Import", 176, 144, 127, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Label7 = GUICtrlCreateLabel("Manufactured Date", 32, 168, 96, 17)$Label8 = GUICtrlCreateLabel("Replacement Plan (Years)", 176, 168, 127, 17)
$Label9 = GUICtrlCreateLabel("Replacment Date", 336, 168, 87, 17)$ManDate = GUICtrlCreateInput("ManDate", 16, 184, 121, 21)
$Years = GUICtrlCreateInput("Years", 176, 184, 121, 21)$ReplaceDate = GUICtrlCreateInput("ReplaceDate", 328, 184, 121, 21)
$Button2 = GUICtrlCreateButton("Update Barcode Data", 104, 264, 273, 33)$Label10 = GUICtrlCreateLabel("Barcode Data", 208, 312, 82, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Label11 = GUICtrlCreateLabel("Asset Tag", 48, 216, 52, 17)$Label12 = GUICtrlCreateLabel("IMEI Number", 200, 216, 66, 17)
$Label13 = GUICtrlCreateLabel("SIM ICC ID", 352, 216, 57, 17)$Asset = GUICtrlCreateInput("Asset", 16, 232, 121, 21)
$IMEI = GUICtrlCreateInput("IMEI", 176, 232, 121, 21)$SIM = GUICtrlCreateInput("SIM", 328, 232, 121, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Dim $BIOS _ComputerGetBIOS($BIOS)
$Manufacturer =$BIOS[1][12]
$Serial =$BIOS[1][16]

GUICtrlSetData($ModSize, 3) GUICtrlSetData($MarginSize, 0)
GUICtrlSetState($Radio4,$GUI_CHECKED)
GUICtrlSetData($ManDate, MDate($Serial))
GUICtrlSetData($Years, 5) GUICtrlSetData($ReplaceDate, MDate($Serial, GUICtrlRead($Years)))
$Updatecheck = GUICtrlRead($Years)
GUICtrlSetData($Asset, "N/A") GUICtrlSetData($IMEI, "N/A")
GUICtrlSetData($SIM, "N/A") While 1$nMsg = GUIGetMsg()
Switch $nMsg Case$GUI_EVENT_CLOSE
Exit
Case $Button2$ALLURBASE = ""
$ALLURBASE =$Manufacturer & @CRLF
$ALLURBASE &= "Serial# " &$Serial & @CRLF
If GUICtrlRead($Asset) <> "N/A" Then$ALLURBASE &= "Asset# " & GUICtrlRead($asset) & @CRLF If GUICtrlRead($IMEI) <> "N/A" Then $ALLURBASE &= "IMEI# " & GUICtrlRead($IMEI) & @CRLF
If GUICtrlRead($SIM) <> "N/A" Then$ALLURBASE &= "SIM# " & GUICtrlRead($SIM) & @CRLF$ALLURBASE &= "Deployment Date " & GUICtrlRead($ManDate) & @CRLF$AllURBASE &= "Replacement Date " & GUICtrlRead($ReplaceDate) GUICtrlSetData($Edit1, $ALLURBASE) Case$Button1
DirCreate(@ScriptDir & "\GeneratedCodes\")
_FileCreate(@ScriptDir & "\LastBarcode.txt")
FileWrite(@ScriptDir & "\LastBarcode.txt", GUICtrlRead($Edit1))$size = GUICtrlRead($ModSize)$margine = GUICtrlRead($MarginSize)$errorcorrect = CheckRadio()

Run(@ComSpec & " /c qrcode.exe -o GeneratedCodes\" & @ComputerName & ".png -l " & $errorcorrect & " -s " &$size & " -m " & $margine & " < lastbarcode.txt") MsgBox(0, "Black Magic Automation", "QRCode Created as " & @ComputerName & ".png") EndSwitch If GUICtrlRead($Years) <> $Updatecheck Then GUICtrlSetData($ReplaceDate, MDate($Serial, GUICtrlRead($Years)))
$Updatecheck = GUICtrlRead($Years)
WEnd

Func MDate($vSerial,$yplus=0, $mplus=0,$dplus=0)

$Year = (StringMid(@Year, 1, 3) & StringMid($vSerial, 4, 1)) + $yplus$Week = StringMid($vSerial, 5, 2)$RawMonth = $Week /4$aMonth = StringSplit($RawMonth, ".")$Month = $aMonth[1] If$aMonth[0] = 2 Then
Switch $aMonth[2] Case 25$Day = "07"
Case 5
$Day = "14" Case 75$Day = "21"
EndSwitch
Else
$Day = "01" EndIf$Manufacture = $Month & "/" &$Day & "/" & $Year Return$Manufacture
EndFunc

If GUICtrlRead($Radio1) =$GUI_CHECKED Then Return "L"
If GUICtrlRead($Radio2) =$GUI_CHECKED Then Return "M"
If GUICtrlRead($Radio3) =$GUI_CHECKED Then Return "Q"
If GUICtrlRead($Radio4) =$GUI_CHECKED Then Return "H"
EndFunc
Edited by ViciousXUSMC

##### Share on other sites

Just thought I would check back in.

I modified the above to incorporate the .dll and your UDF.

Your defaults were a bit different than what I was using so I changed the defaults and expected to get the same result but they are different.

I think its because the .exe is detecting the need for a higher "version" of QR

Attached is a 111x111 .bmp created with the qrcode.udf and a 159x159 .png created by the qrcode.exe

Edit: I think its the error correction I get High with the .exe but Low with the .UDF I have tried both the letter and number so far with no change so I will have to look into it further to see why its not working.

Edit2: I do not know much about .dll and all that but looking in the files

Edit3: Figured it out!

In the .UDF Change This:

If $vErrorCorrect = Default Then$vErrorCorrect = 'M'
Else
Switch StringLower($vErrorCorrect) Case '0', 'l', 'low'$vErrorCorrect = 'L'
Case '1', 'm', 'medium'
$vErrorCorrect = 'M' Case '2', 'q', 'quality'$vErrorCorrect = 'Q'
Case '3', 'h', 'high'
$vErrorCorrect = 'H' Case Else Return "" EndSwitch EndIf To This: If$vErrorCorrect = Default Then
$vErrorCorrect = 'M' Else Switch StringLower($vErrorCorrect)
Case '0', 'l', 'low'
$vErrorCorrect = '0' Case '1', 'm', 'medium'$vErrorCorrect = '1'
Case '2', 'q', 'quality'
$vErrorCorrect = '2' Case '3', 'h', 'high'$vErrorCorrect = '3'
Case Else
Return ""
EndSwitch
EndIf

I also found I can just flip "GenerateBMP" to "GeneratePNG" to get a PNG image instead that is 1/10 the size.

DIT01500N255.bmp

Edited by ViciousXUSMC

##### Share on other sites

I kept it as BMP for ease of use and consistency, but could add the PNG option to it.  I'll see how soon I can put a few minutes toward it.

##### Share on other sites

I user from 1 to 7 characters, all are number, i want the barcode is short to can print in the little paper, the QR code is not accept because my reader dose not support. Can you give me a ideal? Thank you very much.

##### Share on other sites
On 14/9/2018 at 5:22 PM, meomeo192 said:

I user from 1 to 7 characters, all are number, i want the barcode is short to can print in the little paper, the QR code is not accept because my reader dose not support. Can you give me a ideal? Thank you very much.

Easy, create some Control Characters:  In my apps, when I need someone to read a specific qr, I start it with a symbol (a #, a @, a combination of characters like "#RM:").

You can create your QR codes with a fixed combination like "#THISISMYQR:" & $data Doing this, your QRs will always have, at least, 12 characters. In the reading program, you can do then 2 things: Discard any QR that doesn't start with this data: "#THISISMYQR:" and to get the real value of the QR you can do something as easy as: ; Lets asume that you have readed a QR and the readed data is stored in the variable$datareaded

Local $check = StringLeft($datareaded, 12) ; We check that the qr is one of those that we have created for our pourpose

If $check = "#THISISMYQR:" Then ;it is one of our QRs Local$finaldata = Stringtrimleft($datareaded,12) MsgBox(0, "FINE", "The data inside our QR was: " & finaldata) Else MsgBox(0, "ERROR", "This QR was not created by me. The data stored inside it was: " & datareaded) Endif Greets from Barcelona Edit: sorry, I readed really fast and I missed the non qr reader 😅 Edited by Qwerty212 #### Share this post ##### Link to post ##### Share on other sites On 9/14/2018 at 8:22 AM, meomeo192 said: I user from 1 to 7 characters, all are number, i want the barcode is short to can print in the little paper, the QR code is not accept because my reader dose not support. Can you give me a ideal? Thank you very much. Code39 should probably work well for you. Edited by willichan #### 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 • ### Recently Browsing 0 members No registered users viewing this page. • ### Similar Content • By BugFix "Once upon a time ..." than I've made the following: But now exist a new version of the "quricol.dll" for 32 and 64 bit. All parameters can be used now. In the old thread you can see, that is implemented with the help of @TheXman . Thanks for that. Then I revised the GUI and I came up with new possibilities. This has now resulted in a much more powerful tool, which is why I decided to create a new thread on this topic. There are 3 components: QRCreator.au3 This is the base UDF that need for all. You can write your own applications by using it. QRCreatorUI 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 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. Here more in detail: QRCreator.au3 - functions _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) The following parameters will used:$_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 px   $_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.
QRCreatorUI.au3
All information for the actions you've done will shown in the statusbar of the GUI.    But this is my own statusbar, that allows formatting. I've attached them too. QRCreatorCI
available command line parameters   ---------------------------------------------------------------------------------------------------------------    REQUIRED      text=Text for encoding    OPTIONAL      file=path/filename[.ext]  - If ommited, the default will used: @HomeDrive & @HomePath & "\QR_YYYYMMDD_hhmmss"      type=png,bmp,clip         - If ommited, 'png' will used. With clip runs CopyToClipboard.           or combined png/bmp    If file has .ext and type is passed but is different to .ext than will used type      width=int                 - (and height) initializes a resizing of the default created QR-Code                                  Resizing fails, if passed size is smaller as the default generated file.                                REMARK: Only for file creation      scale=int                 - Factor for up scaling the QR-Code                                REMARK: Only for CopyToClipboard      margin=4                  - The margin around the QR-Code in px (Default = 4)      corrlevel=0               - Up to 7%, 15%, 25% or 30% damage [0, 1, 2, 3]. (Default = 0)      sizept=2                  - 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.   ---------------------------------------------------------------------------------------------------------------   return values   ---------------------------------------------------------------------------------------------------------------   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   ---------------------------------------------------------------------------------------------------------------
You find all the stuff also in the function headers.
So that you get an impression, here are a few pictures.
Gallery
QRCode.zip
QRCreatorUI.au3
• By Stacker
Hi all,
i want to start a new application that capture a screen or image from webcam an read all barcode inside the picture.
I have test this code https://www.autoitscript.com/forum/topic/27925-webcam-example/
Works fine for my webcam.
Now i need to read all barcodes (code 128 code39, no 2d) inside the picture. I have found this https://www.codeproject.com/Articles/42852/Reading-Barcodes-from-an-Image-III
It's possible to make a dll from VB source i linked  with this  parameters :  filename, Array of barcode founded, error code and launch from Autoit with function ?
Anyone can help me to make dll and autoit function, i don't know VB.
Thanks
• By corgano
I have seen many different threads about generating barcodes, displaying them, and printing them. However at this point I am completely torn with which method to use. I am making a software that lets the user scan items, enter in information and save it in a SQLite database. For my purposes, I want to be able to display the barcode with number underneath in a similar way to most other controls eg GuiCtrlCreateBarcode( barcodenumber, x, y, width, height ). I also want to be able to print the barcode and have it be readable by the same scanner - The most successful encoding I've found is code128. Here is what I have found so far:
This thread has nice code that saves the output as images Printing is easy and scans properly Displaying the image on a pic control makes it easy to set it's x/y/width/height
But.. The code does not let you directly specify the width / height, so displayed image on GUI is ALWAYS skewed. Getting output images the right size with that code is very difficult I cannot find any examples of drawing barcodes to an image that let you specify width / height This example  Several threads use Static controls Look very nice on GUI, easy to get explicit position and size
But... I know of no way to turn a bunch of static controls into something printable I didn't find any examples that had numbers at the bottom of the barcode The third solution I found was using a barcode font Can look nice, depending on font Shouldn't be hard to print
But.. Depends on additional font being installed Some fonts don't scan correctly How do you specify a width / height of an area you want the barcode to fill when using a font? I'm really at a loss as to how to move forward. Maybe there's an example I missed that is better suited to what I could find? PErhaps someone has experience writing barcode scanning / generating / printing software and can share the experiences. Can someone bounce a few ideas back and forth with me on the best way to proceed?

• Requires quricol32.dll from http://delphi32.blogspot.it/2011/11/quricol-qr-code-generator-library.html
Lots of similar implementations, but this one fits with my other barcode libraries.
×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...