I am unable to scan a QR Code having dark background(dark pink) with lighter QRcode(light pink) on it. I have integrated the zxing barcode scanner in my application to scan codes.. It works perfect for lighter background and dark QRcodes.
I tried this using the default zxing barcode scanner application. But it could not scan such kind of codes.
Following is the QRCode I am trying to scan,
Please suggest some solution.
Thankyou.
If you're holding your phone too close or too far away, it won't scan the code. Try holding your phone about 30 cm (1 foot) away and slowly moving it towards the QR code. Some phone cameras can't focus as well as others close up, so you may have to hold your phone a bit further away.
On click of button_scan_qr_code , CaptureActivity will start scanning using default camera. Once it scans any QR code, it sends back the result to onActivityResult the MainActivity . ZXing also provides online QR Code Generator. Enter the required fields, generate and scan it to get the results.
1. 3D Touch the Chrome app icon and choose Scan QR Code. 2. Pull down to reveal the Spotlight search box, search for "QR" and select Scan QR Code from Chrome's listing.
Contrast of QR Code you included should be enough for most cameras. Problem here is that the ZXing library does not support inverted QR Codes. It only supports dark codes on light background.
To add this support, you need to invert the image yourself. You can use some code similar to this one: http://www.androidsnippets.com/how-to-invert-bitmap-color
Of course, you will need to integrate the ZXing by including the library to accomplish this, not just by Intent (I don't know how you're doing it now) so you can modify some code.
You can add the code to invert the bitmap in the method decode(byte[], int, int) of class DecodeHandler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With