使用zxing创建彩色QR码 [英] Creating colored QR codes using zxing
问题描述
我使用的是google开源的java zxing创作者: http://code.google.com/ p / zxing /
I am using the google open source java zxing creator: http://code.google.com/p/zxing/
可创建QR码。我有一切的地方和工作(我正在加载的java文件使用冷灌输,并将图像写入浏览器。)
to create QR codes. I have everything in place and working (I'm loading the java files using coldfusion and writing the image to the browser.)
我现在想要的是改变黑色QR颜色到别的。有没有一个简单的方法这样做?
What I want now is to change the black QR colour to something else. Is there an easy way of doing this?
我需要编辑一个反编译版本的编码器java文件?
Would I need to edit a decompiled version of the encoder java file? Or is there a way I could add a color argument to the encoding routine?
谢谢
Shaun
Thanks Shaun
推荐答案
MatrixToImageWriter.java
(我假设你使用), javase /
更改常量 BLACK
。它是ARGB格式的 int
,目前的值为 0xFF000000
。将α值保留在 0xFF
。更改其余部分以十六进制格式描述您的颜色。如果你喜欢,你也可以用 WHITE
做同样的操作。
In MatrixToImageWriter.java
(which I assume you are using), under javase/
change the constant BLACK
. It is an int
in ARGB format and currently has value 0xFF000000
. Leave the alpha value at 0xFF
. Change the rest to describe your color in hex format. You can do the same with WHITE
if you like.
这篇关于使用zxing创建彩色QR码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!