主要代码:
@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的二维码
源码文件下载见附件
本文出自 “点滴积累” 博客,请务必保留此出处http://tianxingzhe.blog.51cto.com/3390077/1682862
时间: 2024-09-23 23:00:49