I’m using the zxing C# port to decode a QR barcode.
The code is simple and based on an example I found online (see below).
The problem is, it always throws an “Index was outside the bounds of the array” exception.
My code sample happen to be in VB.NET, but the zxing library is implemented in C#
Dim re As qrcode.QRCodeReader
re = New qrcode.QRCodeReader()
Dim Img As New Bitmap("<image file path here>")
Dim res As com.google.zxing.Result
Dim bufimg As com.google.zxing.client.j2se.BufferedImageMonochromeBitmapSource
bufimg = New client.j2se.BufferedImageMonochromeBitmapSource(Img, False)
res = re.decode(bufimg)
Dim ret As String = res.getText()
I have seen multiple people complaining about the same issue in different forums, but haven’t found any suggested solution.
UPDATE If anyone knows of a different good QR reader that can easily integrate with a .NET application, please recommend
Dont know if this gonna help u, but i paste my code if u want to use: