kenglxn / QRGen

a simple QRCode generation api for java built on top ZXING
http://glxn.net/2012/03/10/qrgen-a-small-wrapper-on-top-of-zxing-for-generating-qrcodes-in-java
1.49k stars 299 forks source link

Suggestion on how to remove image padding? #97

Closed andrevdk closed 6 years ago

andrevdk commented 6 years ago

I am using this library on Android and the generated bitmap has a big padding. Is there any way to remove it before the generation of the bitmap?

kenglxn commented 6 years ago

You should be able to control padding through hints (https://zxing.github.io/zxing/apidocs/com/google/zxing/EncodeHintType.html):

QRCode.from("Hello World").withHint(EncodeHintType.MARGIN, 2)