public
static void encode(String content, String destPath) throws Exception {
QRCodeUtil.encode(content, null, destPath, false); }
public
static void encode(String content, String imgPath,
OutputStream
output, boolean needCompress) throws Exception {
BufferedImage image = QRCodeUtil.createImage(content, imgPath,
needCompress);
ImageIO.write(image, FORMAT_NAME, output); }
public
static void encode(String content, OutputStream output) throws Exception {
QRCodeUtil.encode(content, null, output, false); }
public
static String decode(File file) throws Exception {
BufferedImage image;
image = ImageIO.read(file);
if (image == null) {
return null; }
BufferedImageLuminanceSource source = new BufferedImageLuminanceSource( image);
BinaryBitmap
bitmap = new BinaryBitmap(new HybridBinarizer(source));
相关推荐: