Search code examples
androidandroid-camerazxingqr-code

zxing minimum size on screen of qr to scan


I have used the zxing library to create a QR scanner. On screen is a greenish box, which the QR has to be in for it to be decoded. My problem is that the QR will be decoded if it fills the greenish square, or the phone is far away and the QR only fills a quarter of the greenish square. I would like to make it so that it only decodes if the QR mostly fits the greenish square, not just part of it. I have googled high and low, no results. I have found info on QR length, but I do not think this is what I am after. It may not be possible to do what I want, but its worth asking everybody just for in case. I have attempted to add a screen shot, it wont let me because I don't have 10 reputation.

Thank You All.


Solution

  • Ok, so no method of doing exactly what I want has been found.

    Instead, I will put a button on screen that starts the scanning.

    So first the user lines up the QR in the greenish box, mostly filling it, then clicks scan and detects the QR. Otherwise, if I don't do it this way then it will scan when the QR does not fully fill the greenish box.

    I will accept this as my answer if no one answers in the next few days, just so the question is not left open.

    Not the solution I was after, but kind of works.