Jump to content

Barcode Generator Code 128 B C


 Share

Recommended Posts

I am still not sure about centering the barcode to given area.

I wonder if you THE llewxam could look into my code and see how to get it centered and shrink to given area which is pretty big.

here is what i have

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <EditConstants.au3>
#Include <GuiListView.au3>
#include <array.au3>
#include <file.au3>
#include <ScreenCapture.au3>
Global $NumberFromINI,$NameFromINI,$WholeCodeInput,$Label,$LabelNumber,$BarCodeWindow ;these are created in a loop when pressing CreareNameButton
Global $array[104] ;Barcode Global
Global $CodeArray ;Barcode Global
Global $data ;Barcode Global
Global $L[1] ;Barcode Global
Global $i ;Barcode Global
#region BarCode Arrays
$array[1] = "0¬ ¬00¬11011001100"
$array[2] = "1¬!¬01¬11001101100"
$array[3] = '2¬"¬02¬11001100110'
$array[4] = "3¬#¬03¬10010011000"
$array[5] = "4¬$¬04¬10010001100"
$array[6] = "5¬%¬05¬10001001100"
$array[7] = "6¬&¬06¬10011001000"
$array[8] = "7¬'¬07¬10011000100"
$array[9] = "8¬(¬08¬10001100100"
$array[10] = "9¬)¬09¬11001001000"
$array[11] = "10¬*¬10¬11001000100"
$array[12] = "11¬+¬11¬11000100100"
$array[13] = "12¬,¬12¬10110011100"
$array[14] = "13¬-¬13¬10011011100"
$array[15] = "14¬.¬14¬10011001110"
$array[16] = "15¬/¬15¬10111001100"
$array[17] = "16¬0¬16¬10011101100"
$array[18] = "17¬1¬17¬10011100110"
$array[19] = "18¬2¬18¬11001110010"
$array[20] = "19¬3¬19¬11001011100"
$array[21] = "20¬4¬20¬11001001110"
$array[22] = "21¬5¬21¬11011100100"
$array[23] = "22¬6¬22¬11001110100"
$array[24] = "23¬7¬23¬11101101110"
$array[25] = "24¬8¬24¬11101001100"
$array[26] = "25¬9¬25¬11100101100"
$array[27] = "26¬:¬26¬11100100110"
$array[28] = "27¬;¬27¬11101100100"
$array[29] = "28¬<¬28¬11100110100"
$array[30] = "29¬=¬29¬11100110010"
$array[31] = "30¬>¬30¬11011011000"
$array[32] = "31¬?¬31¬11011000110"
$array[33] = "32¬@¬32¬11000110110"
$array[34] = "33¬A¬33¬10100011000"
$array[35] = "34¬B¬34¬10001011000"
$array[36] = "35¬C¬35¬10001000110"
$array[37] = "36¬D¬36¬10110001000"
$array[38] = "37¬E¬37¬10001101000"
$array[39] = "38¬F¬38¬10001100010"
$array[40] = "39¬G¬39¬11010001000"
$array[41] = "40¬H¬40¬11000101000"
$array[42] = "41¬I¬41¬11000100010"
$array[43] = "42¬J¬42¬10110111000"
$array[44] = "43¬K¬43¬10110001110"
$array[45] = "44¬L¬44¬10001101110"
$array[46] = "45¬M¬45¬10111011000"
$array[47] = "46¬N¬46¬10111000110"
$array[48] = "47¬O¬47¬10001110110"
$array[49] = "48¬P¬48¬11101110110"
$array[50] = "49¬Q¬49¬11010001110"
$array[51] = "50¬R¬50¬11000101110"
$array[52] = "51¬S¬51¬11011101000"
$array[53] = "52¬T¬52¬11011100010"
$array[54] = "53¬U¬53¬11011101110"
$array[55] = "54¬V¬54¬11101011000"
$array[56] = "55¬W¬55¬11101000110"
$array[57] = "56¬X¬56¬11100010110"
$array[58] = "57¬Y¬57¬11101101000"
$array[59] = "58¬Z¬58¬11101100010"
$array[60] = "59¬[¬59¬11100011010"
$array[61] = "60¬¬60¬11101111010"
$array[62] = "61¬]¬61¬11001000010"
$array[63] = "62¬^¬62¬11110001010"
$array[64] = "63¬_¬63¬10100110000"
$array[65] = "64¬`¬64¬10100001100"
$array[66] = "65¬a¬65¬10010110000"
$array[67] = "66¬b¬66¬10010000110"
$array[68] = "67¬c¬67¬10000101100"
$array[69] = "68¬d¬68¬10000100110"
$array[70] = "69¬e¬69¬10110010000"
$array[71] = "70¬f¬70¬10110000100"
$array[72] = "71¬g¬71¬10011010000"
$array[73] = "72¬h¬72¬10011000010"
$array[74] = "73¬i¬73¬10000110100"
$array[75] = "74¬j¬74¬10000110010"
$array[76] = "75¬k¬75¬11000010010"
$array[77] = "76¬l¬76¬11001010000"
$array[78] = "77¬m¬77¬11110111010"
$array[79] = "78¬n¬78¬11000010100"
$array[80] = "79¬o¬79¬10001111010"
$array[81] = "80¬p¬80¬10100111100"
$array[82] = "81¬q¬81¬10010111100"
$array[83] = "82¬r¬82¬10010011110"
$array[84] = "83¬s¬83¬10111100100"
$array[85] = "84¬t¬84¬10011110100"
$array[86] = "85¬u¬85¬10011110010"
$array[87] = "86¬v¬86¬11110100100"
$array[88] = "87¬w¬87¬11110010100"
$array[89] = "88¬x¬88¬11110010010"
$array[90] = "89¬y¬89¬11011011110"
$array[91] = "90¬z¬90¬11011110110"
$array[92] = "91¬{¬91¬11110110110"
$array[93] = "92¬|¬92¬10101111000"
$array[94] = "93¬}¬93¬10100011110"
$array[95] = "94¬~¬94¬10001011110"
$array[96] = "95¬del¬95¬10111101000"
$array[97] = "96¬Fnc3¬96¬10111100010"
$array[98] = "97¬Fnc2¬97¬11110101000"
$array[99] = "98¬Shift¬98¬11110100010"
$array[100] = "99¬Code C¬99¬10111011110"
$array[101] = "100¬Fnc 4¬Code B¬10111101110"
$array[102] = "101¬Code A¬Code A¬11101011110"
$array[103] = "102¬Fnc 1¬Fnc 1¬11110101110"
#endregion
$WindowTitle = "Title"
$Gui = GUICreate ($WindowTitle,1024,768)
$Tab = GUICtrlCreateTab (0,0,1024,768)
#Region Create TAB
$CreateTab = GUICtrlCreateTabItem ("Create")
GUICtrlCreateGroup ("Name your Project",5,25,240,45)
  $CreateNameInput = GUICtrlCreateInput ("Synthes 3.5 4.0 combined locking screws",10,40,190,20)
   GUICtrlSetTip ($CreateNameInput,"This will be your Project Name","Information",1)
   GUICtrlSetState($CreateNameInput, $GUI_FOCUS) ; Focus the input
   Send("+{END}")
GUICtrlCreateGroup ("Create number pattern",5,70,240,100)
  $HospitalINIT = GUICtrlCreateInput ("SAH",20,90,40,20)
   GUICtrlCreateLabel ("Facility Initials",10,110,100)
   GUICtrlSetTip ($HospitalINIT,'St. Anthony Hospital = SA or SAH. Tacoma General Hospital = TG or TGH',"For Example:",1)
  $SterilizationID = GUICtrlCreateCombo ("",80,90,150,20)
   GUICtrlSetData ($SterilizationID,'1-Steam|2-hydrogen peroxide (Sterrad)|3-Ethylene Oxide (ETO)|4-Peracetic Acid|5-Multiple|6-None|7-Disinfection Only|8-Sterilized by Manufactory','1-Steam')
   GUICtrlCreateLabel ("Select Sterilization ID#",100,110,140)
   GUICtrlSetTip ($SterilizationID,'',"For Example:",1)
  $ProjectCount = GUICtrlCreateInput ('0001',20,130,40,20)
   GUICtrlCreateLabel ("Count",25,150,100)
  $ListView = GUICtrlCreateListView ("Project Name|Project number|Location|Quantity|",10,220,350,200)
  $CreateProjectButton = GUICtrlCreateButton ("Create",250,30,40,140)
  GUICtrlCreateGroup ("Barcode Preview",295,25,400,145)
GUICtrlCreateTabItem ("")
#EndRegion Create
#Region Decon TAB
$DecontamTAB = GUICtrlCreateTabItem ("Decontam")
GUICtrlCreateGroup ("Scan your Project",5,25,240,40)
$DeconScanInput = GUICtrlCreateInput ("__Scan....",10,40,190,20)
GUICtrlSetTip ($DeconScanInput,"You can select this field and scan an item or you can manualy enter whole number.","Information",1)
$AddToDecontamListButton = GUICtrlCreateButton ("Add",200,40,40,20)
#EndRegion Decon
#Region Other TAB
GUICtrlCreateTabItem ("")
$AssemblyTAB = GUICtrlCreateTabItem ("Assembly")
GUICtrlCreateTabItem ("")
$SterilizationTAB = GUICtrlCreateTabItem ("Sterilization")
GUICtrlCreateTabItem ("")
$CenterCoreTAB = GUICtrlCreateTabItem ("Center Core")
GUICtrlCreateTabItem ("")
$CaseCartTAB = GUICtrlCreateTabItem ("Case Cart")
GUICtrlCreateTabItem ("")
$ORTAB = GUICtrlCreateTabItem ("OR")
GUICtrlCreateTabItem ("")
#EndRegion Other
GUISetState (@SW_SHOW,$Gui)
_GUICtrlListView_RegisterSortCallBack($ListView)
While 1
$MSG = GUIGetMsg()
If $MSG = $GUI_EVENT_CLOSE Then ExitLoop
If $MSG = $Tab Then
  Switch GUICtrlRead($Tab, 1)  ; Here we find out which one - using the advanced parameter returns the ControlID
   Case $CreateTab
                GUICtrlSetState($CreateNameInput, $GUI_FOCUS) ; Focus the input
                Send("+{END}")
   Case $DecontamTab
    GUICtrlDelete ($Label)
    GUICtrlDelete ($LabelNumber)
    for $i = 1 to (UBound($L) - 1)
     GUICtrlDelete($L[$i])
    Next
                GUICtrlSetState($DeconScanInput, $GUI_FOCUS) ; Focus the input
                Send("+{END}")
  EndSwitch
EndIf
If $MSG = $CreateProjectButton Then
  $CreateNameInputRead = GUICtrlRead ($CreateNameInput)
  $HospitalINITRead = GUICtrlRead ($HospitalINIT)
  $SterilizationIDRead = GUICtrlRead ($SterilizationID)
  $SterilizationNumber = StringLeft ($SterilizationIDRead,1) ;returns "1" instead of "1-Steam"
  $ProjectCountRead = GUICtrlRead ($ProjectCount)
  $WholeCodeInput = ($HospitalINITRead & $SterilizationNumber & $ProjectCountRead)
  MakeBarcode()
  GUICtrlDelete ($Label)
  GUICtrlDelete ($LabelNumber)
  $LabelPos = 305
  $LabelWidth = $i*27
  $Label = GUICtrlCreateLabel ($CreateNameInputRead,$LabelPos,45,$LabelWidth,30,$SS_CENTER)
  ;GUICtrlSetBkColor(-1,0xFFFFFF)
  $LabelNumber = GUICtrlCreateLabel ($HospitalINITRead & $SterilizationNumber & $ProjectCountRead,$LabelPos,140,$LabelWidth,20,$SS_CENTER)
  ;GUICtrlSetBkColor(-1,0xFFFFFF)
  IniWrite ("SetNames.ini","All",$WholeCodeInput,$CreateNameInputRead)
  If MsgBox(4+32,"Question","Would you like to print the label" & @CRLF & "for this newly created Project ?") = 6 Then PrintBarCode()
EndIf
If $MSG = $DecontamTAB Then
  GUICtrlSetState ($DeconScanInput,$GUI_FOCUS)
  ControlClick ($WindowTitle,"","Edit3","primary",2)
EndIf
If $MSG = $AddToDecontamListButton Then
  $ReadDeconScanInput = GUICtrlRead ($DeconScanInput)
  If $ReadDeconScanInput  > "" Then
   FindAssociatedName()
   GUICtrlCreateListViewItem ($NameFromINI & '|' & $NumberFromINI,$ListView)
   MsgBox(0,'',$NumberFromINI)
   MsgBox(0,'',$NameFromINI)
  Else
   MsgBox(0,'Error','dont use blank')
  EndIf
EndIf
WEnd
Func FindAssociatedName()
$NumberFromINI = IniRead ("SetNames.ini","All",$ReadDeconScanInput,"No Project associated with this number.")
$NameFromINI = IniRead ("SetNames.ini","All",$ReadDeconScanInput,"No Project associated with this number.")
EndFunc
#Region Barcode Functions
Func MakeBarcode()
; Delete previous barcode
for $i = 1 to (UBound($L) - 1)
    GUICtrlDelete($L[$i])
Next
; Generate Pattern
$Barcode = IdentifyCodeSwitches($WholeCodeInput)
; Draw new Barcode
Dim $L[StringLen($Barcode) + 1]
$i = 1
While $i <= StringLen($Barcode)
    $col = StringMid($barcode,$i,1)
    if $col = 1 Then
        $L[$i] = GUICtrlCreateLabel("",305 + ($i * 2),75,2,60)
        GUICtrlSetBkColor(-1,0x000000)
    Else
        $L[$i] = GUICtrlCreateLabel("",305 + ($i * 2),75,2,60)
        GUICtrlSetBkColor(-1,0xFFFFFF)
    EndIf
    $i += 1
WEnd
EndFunc
Func IdentifyCodeSwitches($code)
; Identify where code switches should be
$i = 1
$CodeType = "B"                  ;always start with code type B
$len = StringLen($Code)
While $i <= $len
    Select
        Case $CodeType = "B"
            if StringRegExp(StringMid($Code,$i,6),"([0-9][0-9]){3}") = 1 Then
                $Code = StringMid($Code,1,$i - 1) & "¬C¬" & StringMid($Code,$i)
                $CodeType = "C"
                $i += 6 + 3
            Else
                $CodeType = "B"
                $i += 1
            EndIf
        Case $CodeType = "C"
            if StringRegExp(StringMid($Code,$i,2),"([0-9][0-9])") <> 1 Then
                $Code = StringMid($Code,1,$i - 1) & "¬B¬" & StringMid($Code,$i)
                $CodeType = "B"
                $i += 2 + 3
            Else
                $CodeType = "C"
                $i += 2
            EndIf
    EndSelect
    $len = StringLen($Code)
WEnd
;*************************************************************************************
; Add start code B, if not already started C
;*************************************************************************************
if StringMid($Code,1,3) <> "¬C¬" then $Code = "¬B¬" & $Code
;*************************************************************************************
; Split to array, re-assemble code switches
;*************************************************************************************
$CodeArray = StringSplit($code,"")
for $i = 1 to (UBound($CodeArray) - 3)
    Select
        case $CodeArray[$i] & $CodeArray[$i+1] & $CodeArray[$i+2] = "¬B¬"
            $CodeArray[$i] = "[B]"
            $CodeArray[$i+1] = ""
            $CodeArray[$i+2] = ""
        case $CodeArray[$i] & $CodeArray[$i+1] & $CodeArray[$i+2] = "¬C¬"
            $CodeArray[$i] = "[C]"
            $CodeArray[$i+1] = ""
            $CodeArray[$i+2] = ""
    EndSelect
Next
;*************************************************************************************
; Remove empty items
;*************************************************************************************
for $i = (UBound($CodeArray) - 1) to 1 step -1
    if $CodeArray[$i] = "" then _ArrayDelete($CodeArray,$i)
Next
;*************************************************************************************
; Concatenate C number pairs
;*************************************************************************************
$i = 1
While $i <= (UBound($CodeArray) - 1)
    if $CodeArray[$i] = "[C]" Then
        $i += 1
        do
            if $CodeArray[$i] = "" then
                $i += 1
            Else
                $CodeArray[$i] &= $CodeArray[$i + 1]
                $CodeArray[$i + 1] = ""
                $i += 1
            EndIf
        Until $i = (UBound($CodeArray) - 1) Or $CodeArray[$i] = "[B]" or $CodeArray[$i + 1] = "[B]"
    EndIf
    $i += 1
WEnd
;*************************************************************************************
; Remove empty items
;*************************************************************************************
for $i = (UBound($CodeArray) - 1) to 1 step -1
    if $CodeArray[$i] = "" then _ArrayDelete($CodeArray,$i)
Next
;*************************************************************************************
; Replace Items with 128 Code Patterns, and mount checksum
;*************************************************************************************
_ArrayDelete($CodeArray,0)    ;important
If $CodeArray[0] = "[B]" Then
    $CodeArray[0] = "11010010000"
    $SUM = 104
    $CodeType = "[B]"
Else
    $CodeArray[0] = "11010011100"
    $SUM = 105
    $CodeType = "[C]"
EndIf
for $i = 1 to (UBound($CodeArray) - 1)
    if $CodeArray[$i] = "[B]" Then
        $CodeArray[$i] = "10111101110"
        $SUM += $i * 100
        $CodeType = "[B]"
        ContinueLoop
    EndIf
    if $CodeArray[$i] = "[C]" Then
        $CodeArray[$i] = "10111011110"
        $SUM += $i * 99
        $CodeType = "[C]"
        ContinueLoop
    EndIf
    for $j = 1 to (UBound($array) - 1)
        $data = StringSplit($array[$j],"¬")
        Select
            case $CodeType = "[B]"
                if $CodeArray[$i] == $data[2] Then
                    $CodeArray[$i] = $data[4]
                    $SUM += $i * $data[1]
                EndIf
            case $CodeType = "[C]"
                if $CodeArray[$i] == $data[3] Then
                    $CodeArray[$i] = $data[4]
                    $SUM += $i * $data[1]
                EndIf
        EndSelect
    Next
Next
;*************************************************************************************
; Calculate & find checksum item
;*************************************************************************************
$ChecksumItem = Mod($SUM,103)
$data = StringSplit($array[$ChecksumItem + 1],"¬")
_ArrayAdd($CodeArray,$data[4])
;*************************************************************************************
; Add stop item
;*************************************************************************************
_ArrayAdd($CodeArray,"1100011101011")
;*************************************************************************************
; Flatten array
;*************************************************************************************
$CodeArrayString = _ArrayToString($CodeArray,"")
Return $CodeArrayString
EndFunc
Func PrintBarCode()
If @OSVersion <> "Win_XP" Then Sleep(1000)
_ScreenCapture_CaptureWnd(@DesktopDir & "" & @ComputerName & ".jpg", $Gui, 305, 60, 695, 190, False) ;less by 5 then $BarCodeWindow
;_FilePrint (@DesktopDir & "" & @ComputerName & ".jpg")
EndFunc
#EndRegion Barcode Functions
.

You will also notice that i am trying to center name and number labels above and below generated barcode by multiplying the $i variable that is being added by each generated line of barcode, but its not right. I only get approximate result when multiplying it by 27 in line 202. i would also like to have you (if you can) to look at it and give me the correct equasion to calculate the size of the label to match lenght of the generated barcode. I tried it with ControlGetPos ("","",$L[$i]) but its not working and returns 32

Link to comment
Share on other sites

Looks like you were really close - I found that lines 195 and 196 should be:

[autoit]

$LabelPos = 295

$LabelWidth = 400

[autoit]

I have tried the whole variable-defined width thing, nah...most of the time it doesn't help. :D

Then, line 234, set $i to 50. Set #Label and $LabelNimber to white if you prefer, and bingo! :oops:

Ian

My projects:

  • IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged.
  • INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them.
  • PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses.
  • Sync Tool - Folder sync tool with lots of real time information and several checking methods.
  • USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions.
  • Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent.
  • CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction.
  • MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app.
  • 2048 Game - My version of 2048, fun tile game.
  • Juice Lab - Ecigarette liquid making calculator.
  • Data Protector - Secure notes to save sensitive information.
  • VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive.
  • Find in File - Searches files containing a specified phrase.
Link to comment
Share on other sites

awesome

set $i to 50 was the only thing i needed to do (besides white background)

Thanks man :D

whats left now is to figure out how to center generated barcode into given area and shrink it if it gets too long, as well as once you enter what ever into input box, how to you activate ADD button by pressing Enter without having to click it ?

Kinda like when you go on google, type what you loking for and hit enter to start searching. you dont have to click GO, you can just press Enter

I wonder if there is some sort of a virtual label printer on which i can test if label is printing correctly.

Edited by dirty
Link to comment
Share on other sites

awesome

set $i to 50 was the only thing i needed to do (besides white background)

Thanks man :D

whats left now is to figure out how to center generated barcode into given area and shrink it if it gets too long, as well as once you enter what ever into input box, how to you activate ADD button by pressing Enter without having to click it ?

Kinda like when you go on google, type what you loking for and hit enter to start searching. you dont have to click GO, you can just press Enter

I wonder if there is some sort of a virtual label printer on which i can test if label is printing correctly.

The only part of that I can offer real guidance is GUISetAccelerators, check the help file on that for the key association to run a function. Be careful with resizing barcodes - I experimated a long time ago with some free commandline-based JPG resizer and it would screw up the ratios between things so the scanners had a hard time with them........

Ian

My projects:

  • IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged.
  • INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them.
  • PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses.
  • Sync Tool - Folder sync tool with lots of real time information and several checking methods.
  • USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions.
  • Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent.
  • CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction.
  • MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app.
  • 2048 Game - My version of 2048, fun tile game.
  • Juice Lab - Ecigarette liquid making calculator.
  • Data Protector - Secure notes to save sensitive information.
  • VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive.
  • Find in File - Searches files containing a specified phrase.
Link to comment
Share on other sites

thanks for heads up on resize.

Not sure about accelerators but i tried doing this.

While 1
    $MSG = GUIGetMsg()
    If GUICtrlGetState ($CreateNameInput) = $GUI_FOCUS And _IsPressed('0D') Then
            Send ("{TAB}")
            Send ("{ENTER}")
EndIf
Wend

but somehow GUICtrlGetState ($CreateNameInput) = returns blank instead of $GUI_FOCUS.

With that i thought that if control is in focus and Enter is pressed, then do the dew but its not working.

Link to comment
Share on other sites

yes i know that one already, it uses prfile32.exe. Dont like it.

If you want a virtual prinintout to test without using real labels then maybe a pdf creater like CutePDF (which is free) would work for you. I often use it for printing tests.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Dirty;

This line is wrong

If GUICtrlGetState ($CreateNameInput) = $GUI_FOCUS And _IsPressed('0D') Then

If BitAnd(GUICtrlGetState ($CreateNameInput), $GUI_FOCUS) = $GUI_FOCUS And _IsPressed('0D') Then

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Dirty;

This line is wrong

If GUICtrlGetState ($CreateNameInput) = $GUI_FOCUS And _IsPressed('0D') Then

If BitAnd(GUICtrlGetState ($CreateNameInput), $GUI_FOCUS) = $GUI_FOCUS And _IsPressed('0D') Then

having this

If BitAnd(GUICtrlGetState ($CreateNameInput), $GUI_FOCUS) = $GUI_FOCUS And _IsPressed('0D') Then MsgBox(0,'','')

in a gui loop still doesnt work

As for CutePDF, last time i checked they want $50. Free is the converter.

Link to comment
Share on other sites

Very nice. I'm going to have to go through my archives for all of my old bar-coding routines, and translate them into Auto-It.

I did a custom 128 font sometime back too, but that was more pain than it was worth.

Link to comment
Share on other sites

...

As for CutePDF, last time i checked they want $50. Free is the converter.

No, I've downloaded it twice in the last couple of months, once last week. I've never paid or been asked to. The converter is also free as you say.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

  • 1 year later...
  • 4 weeks later...
  • 5 months later...

i'd like you to see some of my work on <snip>]. any suggestion?

REImage reImage = REFile.OpenImageFile("c:/Sample.png", new PNGDecoder());

Linear barcode = new Linear();//create a barcode

barcode.Type = RasterEdge.Imaging.Barcode.Creator.BarcodeType.CODE128;//select barcode type

barcode.Data = "123456789";//set barcode data

barcode.X = 1.0F;//set x

barcode.Y = 60.0F;//set y

barcode.Resolution = 96;//set resolution

barcode.Rotate = Rotate.Rotate0;//set rotate

barcode.DrawBarcode(reImage, 300, 450);//draw barcode on REImage with location x and y

REFile.SaveImageFile(reImage, "c:/code128.png", new PNGEncoder());

Edited by Melba23
Removed URL
Link to comment
Share on other sites

  • Moderators

Mostmore,

We do not accept advertising for payware - do it again and I will treat it as spam. :naughty:

M23

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

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

I know this is kinda old but I just got into learning this and wanting to utilize bar codes.

 

*** EDIT ***

Just to be clear, the script seems to work, it generates a bar code and all but I cannot get my scanner to read it code B.

 

*** EDIT ***

 

I can't quite get it to work for larger bar codes, even though, to my knowledge Code128 is suppose to be limitless, just the image is stretched accordingly?

 

So I'm planning on generating the bar code, doing a window capture to an image, then resizing the image slightly to fit what I need. But I can't get it to scan larger barcodes. Is the code not meant for any longer than X chars?

 

Here is the resized GUI

 

$BC = GUICreate("Code 128 (B/C) Barcode Generator - AndyBiochem 2008", 1400, 286, 1, 1, $WS_EX_TOPMOST)
GUISetOnEvent($GUI_EVENT_CLOSE, "Close")

$Input = GUICtrlCreateInput("", 8, 8, 321, 25)
GUICtrlSetFont(-1,12)

GUICtrlCreateButton("Generate Barcode", 344, 8, 257, 25)
GUICtrlSetOnEvent(-1,"MakeBarcode")

GUICtrlCreateLabel("", 8, 48, 1500, 225)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUISetState(@SW_SHOW)

 

And then the capture of the GUI

 

_ScreenCapture_CaptureWnd(@ScriptDir & "/" & "Barcode" & ".bmp", $BC, 20, 115, 1450, 240, False)

 

What works (Barcode Input)

 

13-125-13|6119|TMMI|Prolift

 

What doesn't work (Barcode Input)

 

12-125-13|6119|TMMI|Prolift|350Grey|Robert

 

Anyone know why A works but not B?

Edited by Damein

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...