How do I generate and read barcodes with VB6? Today to share two paragraphs of VB6 code, about the Barcode Reader SDK Barcode generation and reading.
Generate Barcodes:
Set <span data-scayt_word= "BC" data-scaytid= "8" >bc</span> = <span data-scayt_word= "CreateObject" Data-scaytid= >CreateObject</span> ("Bytescout.BarCode.Barcode") ' Set <span data-scayt_word= ' Symbology "data-scaytid=" >symbology</span> to <span data-scayt_word= "Code39" data-scaytid= ">" CODE39</SPAN>BC. symbology = 1 ' 1 = <span data-scayt_word= "Code39" data-scaytid= "+" >Code39</span> <span data-scayt_word= "Symbology" data-scaytid= ">symbology</span> type ' Set barcode value to ENCODEBC. Value = "012345" BC. SaveImage "Code39.png" Set <span data-scayt_word= "BC" data-scaytid= "9" >bc</span> = Nothing
Reading barcodes:
Set <span data-scayt_word= "BC" data-scaytid= ">bc</span> = <span data-scayt_word=" CreateObject " Data-scaytid= >CreateObject</span> ("Bytescout.BarCodeReader.Reader") ' Limit to <span data-scayt_ Word= "1D" data-scaytid= "1" >1D</span> barcodes search only (<span data-scayt_word= "2d" data-scaytid= "2" >2d</span> is not included to speed up search) BC. Typetofind = 2066431 ' 2066431=symbologyfilter.findall1dbc.readfromfile "code39.png" for i = 0 to BC. Foundcount-1<span data-scayt_word= "Msgbox" data-scaytid= "3" >Msgbox</span> "Found barcode on page #" & & Lt;span data-scayt_word= "CStr" data-scaytid= "4" >CStr</span> (BC. Getfoundbarcodepage (i)) & "with Type" & <span data-scayt_word= "Cstr" data-scaytid= "5" >Cstr</span> (BC. Getfoundbarcodetype (i)) & "and value" & BC. Getfoundbarcodevalue (i) nextset <span data-scayt_word= "BC" data-scaytid= ">bc</span> = Nothing"
This article was translated from barcode
BarCode Reader SDK Tutorial: Using VB6 for barcode generation and Reading