Is it possible to change the 'dot' shape in a QR Code generated by ZXing?

故事扮演 提交于 2020-01-04 07:27:10

问题


Currently, I'm using ZXing to generate QR Codes. I have no problems in generating and reading the codes, and can change the colour scheme without any issues. I was wondering if it is possible to change the shape of the generated codes from the traditional squares to 'dots' or circles using ZXing?

I've seen images and examples of this, but I haven't seen any example solutions using ZXing.

Looking for something like:

If it is possible to do with ZXing? I would appreciate any example code.


回答1:


The library doesn't render the QR code actually, excepting that there's a bit of utility code to write it out as an image in the javase/ module. So I think you would mostly be writing your own code or copying a bit of that. It's not hard. I don't think it's a great idea to render this way as it hurts readability, but probably still substantially works.




回答2:


I had a similar issue. I ended up forking zxing and using JitPack to include my fork with Maven. I implemented functionality for RGB masking and for drawing circles and outlined squares as dot shapes. Here is the repository: https://github.com/flotwig/zxing



来源:https://stackoverflow.com/questions/24121552/is-it-possible-to-change-the-dot-shape-in-a-qr-code-generated-by-zxing

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