BarCode Reader SDK使用教程:用VB6实现条码的生成和读取

本文提供两段VB6代码示例,详细解释如何利用BarCode Reader SDK生成及读取条码,适合VB6开发者参考学习。
摘要由CSDN通过智能技术生成

如何用VB6生成和读取条码?今天给大家分享两段VB6代码,关于在BarCode Reader SDK条码的生成和读取。

BarCode Reader SDK下载】

生成条码:

Set <span data-scayt_word="bc" data-scaytid="8">bc</span> = <span data-scayt_word="CreateObject" data-scaytid="10">CreateObject</span>("Bytescout.BarCode.Barcode")

' set <span data-scayt_word="symbology" data-scaytid="11">symbology</span> to <span data-scayt_word="Code39" data-scaytid="13">Code39</span>
bc.Symbology = 1 ' 1 = <span data-scayt_word="Code39" data-scaytid="14">Code39</span> <span data-scayt_word="symbology" data-scaytid="12">symbology</span> type

' set barcode value to encode
bc.Value = "012345"

bc.SaveImage "Code39.png"

Set <span data-scayt_word="bc" data-scaytid="9">bc</span> = Nothing


读取条码:

Set <span data-scayt_word="bc" data-scaytid="17">bc</span> = <span data-scayt_word="CreateObject" data-scaytid="19">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> are not included to speed up search)
bc.TypeToFind = 2066431 ' 2066431=SymbologyFilter.FindAll1D

bc.ReadFromFile "Code39.png"

For i = 0 To bc.FoundCount - 1
<span data-scayt_word="Msgbox" data-scaytid="3">Msgbox</span> "Found barcode on page #" & <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)

Next

Set <span data-scayt_word="bc" data-scaytid="18">bc</span> = Nothing


本文译自BarCode
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值