Tag: code128

在Java中用Zxing阅读QRCode

关于使用Zxing的一些问题…… 我编写以下代码来从图像中读取条形码: public class BarCodeDecode { /** * @param args */ public static void main(String[] args) { try { String tmpImgFile = “D:\\FormCode128.TIF”; Map tmpHintsMap = new EnumMap(DecodeHintType.class); tmpHintsMap.put(DecodeHintType.TRY_HARDER, Boolean.TRUE); tmpHintsMap.put(DecodeHintType.POSSIBLE_FORMATS, EnumSet.allOf(BarcodeFormat.class)); tmpHintsMap.put(DecodeHintType.PURE_BARCODE, Boolean.FALSE); File tmpFile = new File(tmpImgFile); String tmpRetString = BarCodeUtil.decode(tmpFile, tmpHintsMap); //String tmpRetString = BarCodeUtil.decode(tmpFile, null); System.out.println(tmpRetString); } catch (Exception tmpExpt) { […]