每个条码结果包含以下的属性参数:
Barcode value
Barcode type
Confidence
Location
Skew
由于Barcode Xpress可以从一个单一的扫描中返回多个条码结果,检测的条码结果都可以按照下面的标准来进行存储,但是需要注意的是所有解决了的条码将会排在没有解决的条码之前。
-
- Confidence因素是决定条码结果排序的条件,一般是从高往低排列。Confidence属性将会获得已经识别过的条码的Confidence。
- 下面,对于有着相同的Confidence的任意条码,将会从上到下,然后从左往右的通过位置来进行排序。
- Sort the results top to bottom
- Dim BarcodeArray() As BarcodeInfo
- Redim BarcodeArray(0 To BarcodeXpress1.NumBarcodes - 1)
- ' fill the user type array
- For i = 0 To BarcodeXpress1.NumBarcodes - 1
- BarcodeXpress1.GetBarcode i
- BarcodeArray(i).CodeName = BarcodeXpress1.BarcodeCodeName
- BarcodeArray(i).result = BarcodeXpress1.BarcodeResult
- BarcodeArray(i).CheckSumOK = BarcodeXpress1.CheckSumOK
- BarcodeArray(i).Confidence = BarcodeXpress1.Confidence
- BarcodeArray(i).Length = BarcodeXpress1.ResultLen
- BarcodeArray(i).X = BarcodeXpress1.BarcodeX
- BarcodeArray(i).Y = BarcodeXpress1.BarcodeY
- BarcodeArray(i).H = BarcodeXpress1.BarcodeH
- BarcodeArray(i).W = BarcodeXpress1.BarcodeW
- Next i
- ' actual sort results top to bottom
- Dim temp As BarcodeInfo
- For i = Ubound(BarcodeArray) - 1 To 0 Step -1
- For j = 0 To i
- If BarcodeArray(j).Y > BarcodeArray(j + 1).Y Then
- temp = BarcodeArray(j + 1)
- BarcodeArray(j + 1) = BarcodeArray(j)
- BarcodeArray(j) = temp
- End If
- Next
- Next