Barcode Xpress for ActiveX v14.0 - Updated
Developer Guide / How To / Access Results
In This Topic
    Access Results
    In This Topic

    Get Barcode Results

    The AnalyzehDib method is used to recognize the barcodes in the image.

    Order of Results

    Since Barcode Xpress can return multiple barcode results from a single scan, the detected barcode results (both solved and unsolved) will be sorted using the following criteria. Note that all solved barcodes will be ordered before unsolved barcodes.

    1. First, the confidence factor is used to sort the barcode results from highest confidence to lowest. The Confidence property gets the confidence of the barcode that was recognized.
    2. Next, for any barcodes with the same confidence, they will then be sorted by their location, from top to bottom, then left to right.
    VB6 - Example code to get multiple barcode results (in an array)
    Copy Code
    '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
    

    1D barcode values are generally 7 bit ASCII, except for Code 128, which permits the use of 8 bit data. If you are using values above 127, you must use the GetBarcodeResultDataValue method instead of the BarcodeResult property, and your data must be encoded. Also, the reader and writer must both use the same character set.

    See the Barcode Xpress Overview topic for code examples on recognition results.

     

    See Also