Package com.google.zxing

Examples of com.google.zxing.Result


    }
   
    private void checkFormat(File file, BarcodeFormat format) throws IOException {
        Reader reader = new MultiFormatReader();
        BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(new BufferedImageLuminanceSource(ImageIO.read(file))));
        Result result;
        try {
            result = reader.decode(bitmap);
        } catch (ReaderException ex) {
            throw new IOException(ex);
        }
       
        assertEquals(format, result.getBarcodeFormat());
    }
View Full Code Here


                .getTypeConverter()
                .mandatoryConvertTo(BufferedInputStream.class, stream);
        final BinaryBitmap bitmap = new BinaryBitmap(
                new HybridBinarizer(
                        new BufferedImageLuminanceSource(ImageIO.read(in))));
        final Result result = reader.decode(bitmap, readerHintMap);
       
        // write the found barcode format into the header
        exchange.getOut()
                .setHeader(Barcode.BARCODE_FORMAT, result.getBarcodeFormat());
       
        return result.getText();
    }
View Full Code Here

    QRCodeReader reader = new QRCodeReader();

    try {
      @SuppressWarnings("rawtypes")
      Hashtable hints = new Hashtable();
      Result result = reader.decode(bitmap, hints);
      log.info("Decoded image successfully, result was : '" + result.getText() + "'");

      return result.getText();
    } catch (ReaderException e) {
      // the data is improperly formatted
      log.debug(e.getMessage());
      log.error("Error while decoding image", e);
    }
View Full Code Here

                .getTypeConverter()
                .mandatoryConvertTo(BufferedInputStream.class, stream);
        final BinaryBitmap bitmap = new BinaryBitmap(
                new HybridBinarizer(
                        new BufferedImageLuminanceSource(ImageIO.read(in))));
        final Result result = reader.decode(bitmap, readerHintMap);
       
        // write the found barcode format into the header
        exchange.getOut()
                .setHeader(Barcode.BARCODE_FORMAT, result.getBarcodeFormat());
       
        return result.getText();
    }
View Full Code Here

TOP

Related Classes of com.google.zxing.Result

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.