主要代码:
@SuppressWarnings({"rawtypes","unchecked","finally"})
public class Test {
public static void main(String[] args) throws IOException {
Test test = new Test();
String content = "http://www.baidu.com";
test.createQrCode(content, 3000, 3000, "C:/imgQRCode.jpg","C:/logo.jpg","png",0xFF000000,0xFFFFFFFF);
//解析二维码
String text = test.decode("C:/imgQRCode.jpg");
System.out.println(text);
}
只要运行com.zxing.imgQRCode包下的Test.java即可生成带彩色logo的二维码
源码文件下载见附件
转载于:https://blog.51cto.com/tianxingzhe/1682862