qrcode解析出来是一长串数字??求解
package com.wk.qrcode;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import jp.sourceforge.qrcode.QRCodeDecoder;
public class ReadQRCode {
public static void main(String[] args) throws IOException {
File file = new File("D://img.png");
BufferedImage bufferedImage = ImageIO.read(file);
QRCodeDecoder codeDecoder = new QRCodeDecoder();
String result = new String(codeDecoder.decode(new MyQRCodeImage(bufferedImage)));
System.out.println(result);
}
}
package com.wk.qrcode;
import java.awt.image.BufferedImage;
import jp.sourceforge.qrcode.data.QRCodeImage;
public class MyQRCodeImage implements QRCodeImage {
BufferedImage bufferedImage;
public MyQRCodeImage(BufferedImage bufferedImage) {
this.bufferedImage = bufferedImage;
}
@Override
public int getHeight() {
return bufferedImage.getHeight();
}
@Override
public int getPixel(int arg0, int arg1) {
return bufferedImage.getRGB(arg0, arg1);
}
@Override
public int getWidth() {
return bufferedImage.getWidth();
}
}
结果打印出来是:
19628671028299113646982254461625629964540660043172309990720326327708969541999728475429321813549061834182907580805898539388735496775103106854592411992889663010198072995495752784186816116372008403787635790855390000000000000000000000000000000000000000000000000000000000000000000000