Radbarcodereader in WPF: IndexOutOfRangeException

1 Answer 48 Views
BarCode
Peter
Top achievements
Rank 1
Peter asked on 23 Jan 2023, 05:48 PM

Dear Team,

I wanted to try the Radbarcodereader in WPF. I opened a new project with .Framework 4.7 

and i just pulled out a Radbarcodereader to an empty WPF window.

Simply started the app, and browsed some random images with barcodes, but every time i push the "decode image" i get IndexOutOfRangeException from the control.

All propertises of the control are on default, what do i have to set up to make it work?

I have tried without control, only by code:

    Private Sub Button_Click(sender As Object, e As RoutedEventArgs)
        Dim imageSource = img_Camera.Source
        Dim decoder As New BarcodeDecoder()
        decoder.ImageSource = imageSource
        AddHandler decoder.DecodingComplete, AddressOf OnDecodingComplete
        decoder.StartDecoding()
    End Sub
    Private Sub OnDecodingComplete(ByVal sender As Object, ByVal e As DecodingEventArgs)
        Dim decodeResult As String
        If String.IsNullOrEmpty(e.ErrorMessage) Then
            decodeResult = String.Format("Code Type: {0}" & ControlChars.Lf & "Result: {1}", e.CodeType, e.Result)
        Else
            decodeResult = e.ErrorMessage
        End If
        txt_RESULT.Text = decodeResult
    End Sub

 

At this line:     decoder.StartDecoding()

i also  get the IndexOutOfRangeException 

 

Please help :)

thanks

Peter B.

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 26 Jan 2023, 11:54 AM

Hello Peter,

Thank you for the provided code snippet.

Based on it, I set up a small sample project where I've included a simple QR code and by invoking the logic from the code you shared, the reader is able to correctly decode it.

I'm attaching the project in question to my reply for your reference. Can you please test this project with the barcodes you browsed and see if the exception still occurs?

If that is the case, please attach these barcodes to the project and send it back to me so that I can further investigate.

Regards,
Dilyan Traykov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Peter
Top achievements
Rank 1
commented on 28 Jan 2023, 12:04 PM | edited

Dear Dilyan,

 

Yes, your code runs with your image.

But if i change the image to mine the same error comes.
I attach the file

 

Peter

Dilyan Traykov
Telerik team
commented on 01 Feb 2023, 11:33 AM

Hello Peter,

Thank you for the provided image.

The attached barcode seems to be of the DataMatrix type which is currently not supported by the RadBarcodeReader. You can vote for the following feature request in our feedback portal regarding this: BarcodeReader: Add support for DataMatrix.

You can also follow the item to get notified about any changes in its status.

Peter
Top achievements
Rank 1
commented on 04 Feb 2023, 11:47 AM

I added a vote, but i have a comment here. The errorhandling should be a bit better, since it speaks about an array.
It should throw something like "There is no supported barcode on the image"
However, if i ask it to analyze a photo without any barcode, it also drops this array thing... 

 

Peter

Dilyan Traykov
Telerik team
commented on 06 Feb 2023, 09:33 AM

Hello Peter,

Thank you for your feedback. I've added it to our internal backlog item so that we can take it into account when addressing this.
Tags
BarCode
Asked by
Peter
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or