Failed to scan QRCode through zxing client

I cannot scan a QR code with a dark background (dark pink) with a lighter QR code (light pink) on it. I have included the zxing barcode scanner in my code scanning application. It works great for lighter backgrounds and darker QR codes.

I tried this using the default zxing default barcode scanner application. But he could not scan such codes.

Below is the QRCode I'm trying to scan, enter image description here

Please suggest some solution.

Thankyou.

+6
source share
1 answer

The contrast of the QR code you have included should be sufficient for most cameras. The problem here is that the ZXing library does not support inverted QR codes. It only supports dark codes on a light background.

To add this support, you need to invert the image yourself. You can use code similar to this: http://www.androidsnippets.com/how-to-invert-bitmap-color

Of course, you will need to integrate ZXing by including the library for this, and not just using Intent (I don't know how you do it now), so you can change the code.

You can add code to invert the bitmap in the decode (byte [], int, int) method of the DecodeHandler class.

+1
source

All Articles