Package com.google.zxing

Examples of com.google.zxing.Reader


        this.checkFormat(in, format);
        in.delete();
    }
   
    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


        }
       
        fw.close();
        tmpfile.deleteOnExit();

        Reader barcodeReader = new MultiFormatReader();
        BufferedImage image = ImageIO.read(tmpfile);
        MonochromeBitmapSource source = new BufferedImageMonochromeBitmapSource(image);
       
        try
        {
            Result result = barcodeReader.decode(source);          
            System.out.println(result.getText());
            System.exit(0);
        }
       
        catch (Exception e)
View Full Code Here

TOP

Related Classes of com.google.zxing.Reader

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.