Support Center

Reading Barcodes

Steve Fowler Apr 01, 2015 12:13PM EDT

Barcode Decoder is not always reading barcodes, even though the old software we used to use handle it correctly (DTK)

Below is a snippet of code, we can supply the failed image if required.

Dim result as String
Dim decoder As New DTI.ImageMan.Barcode.BarcodeDecoder()
Dim barcode As Barcode.Result

Try
barcode = decoder.Decode(viewer1.Images.CurrentImage, PossibleFormats())
result = barcode.Text
Catch
End Try

We have even tried using it with DecodingOptions, snippet of code below

Try
Dim lSource As LuminanceSource = New RGBLuminanceSource(AxImageViewer1.Images.CurrentImage, AxImageViewer1.Images.CurrentImage.Width, AxImageViewer1.Images.CurrentImage.Height)

Dim image As New BinaryBitmap(New DTI.ImageMan.Barcode.Common.HybridBinarizer(lSource))

Dim decodingOptions As New System.Collections.Generic.Dictionary(Of DecodeOptions, Object)
decodingOptions.Add(DecodeOptions.TryHarder, True)
decodingOptions.Add(DecodeOptions.PossibleFormats, PossibleFormats())

Dim instance As New Barcode.OneD.BarcodeOneDDecoder(decodingOptions)
Dim barcode As Barcode.Result = instance.Decode(image)
result = barcode.Text
Catch
End Try

Is there anything we are doing wrong?

Regards
Steve

1 Data Techniques Response

Up 1 Rated Down
DTI Support  Data Techniques Employee Apr 01, 2015 12:22PM EDT

Hi,

That looks OK. Can you please email us one or more images that you are having issues with so we can see whats happening ? Send them to us at support@data-tech.com

Thanks for your interest in our products and please let us know if you have any questions.

Sincerely,
Sean
Data Techniques Support

This question is closed to new answers.

Contact Us