1D barcodes recognition object (Pro)
VB Example (Visual Basic) | Copy Code |
---|---|
Public Function T_BarcodeProNmb(ByRef Ci As CiServer, sFileName, nMaxBarcodeCount) ' Find upto Code 39 or Code 128 barcode in Upper left corner Dim Bc As CiBarcodePro: Set Bc = Ci.CreateBarcodePro ' Open image from file Bc.Image.Open sFileName ' Set-up zone Dim Zone As CiImage Set Zone = Bc.Image.CreateZone(500, 100, 1500, 800) Bc.Image = Zone ' Configure barcode Bc.Type = cibfCode128 Or cibfCode39 Bc.Algorithm = cibBestSpeed Bc.Directions = cibHorz ' Read barcodes Dim Barcode As CiBarcode, nCnt: nCnt = 0 Set Barcode = Bc.FirstBarcode Do While (Not Barcode Is Nothing) ' Process barcode T_DisplayBarcode Barcode nCnt = nCnt + 1 If (nCnt = nMaxBarcodeCount) Then Exit Do Set Barcode = Bc.NextBarcode Loop End Function Public Function T_BarcodeProAll(ByRef Ci As CiServer, sFileName) Dim Bc As CiBarcodePro: Set Bc = Ci.CreateBarcodePro ' Open image from file Bc.Image.Open sFileName ' Configure barcode Bc.AutoDetect1D = ciTrue Bc.Type = cibPATCH ' Or cibCODE_39 Or cibI25 Bc.Directions = cibHorz Or cibVert Or cibDiag Bc.Algorithm = cibBestRecognition ' Read barcodes Dim Barcode As CiBarcode Bc.Find 0 For Each Barcode In Bc.Barcodes ' Process barcode T_DisplayBarcode Barcode Next End Function |