How to read barcodes from an image file
import com.keepautomation.barcodereader.BarcodeReader;
import com.keepautomation.barcodereader.BarcodeType;
...
String[] msgs = BarcodeReader.readBarcodeMessage("C:/Sample.png", BarcodeType.Code128);
...
How to read barcodes from a BufferedImage
import com.keepautomation.barcodereader.BarcodeReader;
import com.keepautomation.barcodereader.BarcodeType;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
...
BufferedImage bi = ImageIO.read(new File("C:/Sample.png"));
String[] msgs = BarcodeReader.readBarcodeMessage(bi, BarcodeType.Code128);
...
How to read barcode from a specified area in the image
import com.keepautomation.barcodereader.BarcodeReader;
import com.keepautomation.barcodereader.BarcodeType;
import com.keepautomation.barcodereader.Region;
import java.util.ArrayList;
...
ArrayList<Region> regions = new ArrayList<Region>();
// xMin: Minimum X of the scan area, in % of the image width.
// xMax: Maximum X of the scan area, in % of the image width.
// yMin: Mimimum Y of the scan area, in % of the image height.
// yMax: Maximum Y of the scan area, in % of the image height.
regions.add(new Region(0F, 100F, 0F, 20F));
String[] msgs = BarcodeReader.readBarcodeMessage("C:/Sample.png", BarcodeType.Code128, regions);
...