how to add logo to qr codes

China☆狼群 提交于 2019-12-09 13:39:53

问题


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


回答1:


You will have to add an image overlay perhaps using another image library. I managed to find this resource that was able to do it. http://skrymerdev.wordpress.com/2012/09/22/qr-code-generation-with-zxing/

However I am certain you cannot add an image directly in the center of an QR code it will not allow the QR code to scan. You may be able to put a small one at the top.




回答2:


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



来源:https://stackoverflow.com/questions/18296555/how-to-add-logo-to-qr-codes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!