How to add logo to qr codes

I am using zxing (java) to generate qr codes and want to know how to add logo to qr code. Is there a built-in method for adding a logo to it or any other for it.

+3
source share
2 answers

You will need to add an image overlay, possibly using a different image library. I managed to find this resource that could do this. http://skrymerdev.wordpress.com/2012/09/22/qr-code-generation-with-zxing/

However, I am sure that you cannot add the image directly to the center of the QR code, it will not allow scanning the QR code. You can put a little one at the top.

enter image description here

+3
source

You can use the set , setRegion and flip methods of the setRegion output to change the bits in the output matrix and add any (if you have a good level of error correction) monochrome image to your output code, or you can export your BitMatrix to a mutable Image and do everything whatever you want with Image.getGraphics() , which gives you a built-in Graphics object where you can draw as usual, but remember to increase the level of ERROR_CORRECTION.

+4
source

Source: https://habr.com/ru/post/1241895/


All Articles