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


    如何用VB6生成和读取条码?今天给大家分享两段VB6代码,关于在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
  • 相关阅读:
    webpack 代码拆分,按需加载
    Linux 安装 node
    H5项目常见问题及注意事项
    低耦合,高内聚。实乃至理名言
    Generator 函数学习笔记
    async 函数学习笔记
    JavaScript 中的 Thunk 函数
    Promise 学习笔记
    vb.net WIN32API 获取listview的值
    vb WIN32 API获取syslistview行数
  • 原文地址:https://www.cnblogs.com/jp294936239/p/4929829.html
Copyright © 2020-2023  润新知