• 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
  • 相关阅读:
    DMA
    [计网笔记] 应用层
    为博客添加网易云音乐播放器外链
    acm对拍程序 以及sublime text3的文件自动更新插件auto refresh
    操作系统---内存管理(上) 概念 覆盖交换技术 连续分配管理方式
    操作系统---死锁的检测和解除
    C++ bitset的使用
    Codeforces Round #647 (Div. 2)
    sublime Text3 实现2:1:1三分屏效果
    操作系统---信号量以及四个进程同步问题
  • 原文地址:https://www.cnblogs.com/jp294936239/p/4929829.html
Copyright © 2020-2023  润新知