com.aspose.barcoderecognition
Class BarCodeReader

java.lang.Object
  extended by com.aspose.barcoderecognition.BarCodeReader

public class BarCodeReader
extends Object

BarCodeReader encapsulates an image which may contain one or several barcodes, it then can perform Read operation to detect barcodes


 Detect an code39 barcode with supplement
 
 [C#]
 BarCodeReader reader;
 BarCodeReader reader;
 reader = new BarCodeReader(@"c:\test.jpg",BarCodeReadType.Code39Standard);
 while(reader.Read())
 {
 Console.WriteLine("BarCode Type: "+reader.GetReadType());
 Console.WriteLine("BarCode CodeText: " + reader.GetCodeText());
 }
 reader.Close();
 [VB.NET]
 Dim reader As BarCodeReader
 reader = New BarCodeReader("c:\test.jpg",BarCodeReadType.Code39Standard)
 While reader.Read()
 Console.WriteLine("BarCode Type: " + reader.GetReadType())
 Console.WriteLine("BarCode CodeText: " + reader.GetCodeText())
 End While
 reader.Close()
 


Constructor Summary
BarCodeReader(BinarizedBitmap binarizedBitmap)
           
BarCodeReader(BinarizedBitmap image, BarCodeReadType type)
           
BarCodeReader(BufferedImage image)
           BarCodeReader constructor from an image
BarCodeReader(BufferedImage image, BarCodeReadType type)
           Initializes a new instance of the BarCodeReader class.
BarCodeReader(BufferedImage image, Rectangle area, BarCodeReadType type)
           
BarCodeReader(InputStream stream)
           
BarCodeReader(InputStream stream, BarCodeReadType type)
           
BarCodeReader(String filename)
           BarCodeReader constructor
BarCodeReader(String filename, BarCodeReadType type)
           Initializes a new instance of the BarCodeReader class.
 
Method Summary
 void close()
           Closes barcode reader.
 int getBarCodeOrientation()
           
 byte[] getCodeBytes()
           
 String getCodeText()
           Gets the code text.
 boolean getConfirmCheckSum()
           Gets or sets if the checksum need to be confirmed.
 int getCustomerInformationInterpretingType()
           Gets or sets the Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other.
 int getCustomizedScanStrength()
           
 int getCustomizedThreshold()
           Gets or sets the the threshold value.This property works only the ThresholdHints.Customized Hints was set.
 int getExpectedBarCodeCount()
           Expected barcodes to be found.The reader will stop reading the image once it found barcodes more than this value.
 String getMacroPdf417FileID()
           Gets the file ID of the barcode, only available with MacroPdf417.
 boolean getMacroPdf417LastSegment()
           Gets the last segment flag,only available with MacroPdf417..
 int getMacroPdf417SegmentID()
           Gets the segment ID of the barcode,only available with MacroPdf417.
 BarCodeReadType getReadType()
           Gets the barcode type.
 BarCodeRegion getRegion()
           Gets the barcode region.
 int getTimeout()
           
 boolean read()
           Reads barcode from the image.
 void setConfirmCheckSum(boolean value)
           
 void setCustomerInformationInterpretingType(int value)
           
 void setCustomizedScanStrength(int value)
           
 void setCustomizedThreshold(int value)
           
 void setExpectedBarCodeCount(int value)
           
 void setHints(RecognitionHints hints)
           
 void setTimeout(int value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BarCodeReader

public BarCodeReader(BufferedImage image)

BarCodeReader constructor from an image

Parameters:
image - A Bitmap instance containing the image

BarCodeReader

public BarCodeReader(BufferedImage image,
                     BarCodeReadType type)

Initializes a new instance of the BarCodeReader class.

Parameters:
image - The image.
type - The BarCodeReadType.

BarCodeReader

public BarCodeReader(BufferedImage image,
                     Rectangle area,
                     BarCodeReadType type)

BarCodeReader

public BarCodeReader(BinarizedBitmap image,
                     BarCodeReadType type)

BarCodeReader

public BarCodeReader(String filename)

BarCodeReader constructor

Parameters:
filename - The filename.

BarCodeReader

public BarCodeReader(String filename,
                     BarCodeReadType type)

Initializes a new instance of the BarCodeReader class.

Parameters:
filename - The filename.
type - The BarCodeReadType.

BarCodeReader

public BarCodeReader(InputStream stream)

BarCodeReader

public BarCodeReader(InputStream stream,
                     BarCodeReadType type)

BarCodeReader

public BarCodeReader(BinarizedBitmap binarizedBitmap)
Method Detail

getTimeout

public int getTimeout()

setTimeout

public void setTimeout(int value)

getCustomizedScanStrength

public int getCustomizedScanStrength()

setCustomizedScanStrength

public void setCustomizedScanStrength(int value)

getCustomizedThreshold

public int getCustomizedThreshold()

Gets or sets the the threshold value.This property works only the ThresholdHints.Customized Hints was set.


setCustomizedThreshold

public void setCustomizedThreshold(int value)

getConfirmCheckSum

public boolean getConfirmCheckSum()

Gets or sets if the checksum need to be confirmed.


setConfirmCheckSum

public void setConfirmCheckSum(boolean value)

getExpectedBarCodeCount

public int getExpectedBarCodeCount()

Expected barcodes to be found.The reader will stop reading the image once it found barcodes more than this value. Default value is int.MaxValue.


setExpectedBarCodeCount

public void setExpectedBarCodeCount(int value)

getCustomerInformationInterpretingType

public int getCustomerInformationInterpretingType()

Gets or sets the Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other.


setCustomerInformationInterpretingType

public void setCustomerInformationInterpretingType(int value)

close

public void close()

Closes barcode reader.


read

public boolean read()

Reads barcode from the image.


 Detect AllSupportedTypes
 
 [C#]
 BarCodeReader reader;
 reader = new BarCodeReader(@"c:\test.jpg");
 while(reader.Read())
 {
     Console.WriteLine("BarCode Type: "+reader.GetReadType());
     Console.WriteLine("BarCode CodeText: " + reader.GetCodeText());
 }
 reader.Close();
 [VB.NET]
 Dim reader As BarCodeReader 
 reader = New BarCodeReader("c:\test.jpg") 
 While reader.Read() 
     Console.WriteLine("BarCode Type: " & reader.GetReadType()) 
     Console.WriteLine("BarCode CodeText: " & reader.GetCodeText()) 
 End While 
 reader.Close()
 

Returns:
True if the next barcode was read successfully; false if there are no more nodes to read.

setHints

public void setHints(RecognitionHints hints)

getCodeText

public String getCodeText()

Gets the code text.

Returns:
The code text of the barcode.

getBarCodeOrientation

public int getBarCodeOrientation()

getCodeBytes

public byte[] getCodeBytes()

getMacroPdf417FileID

public String getMacroPdf417FileID()

Gets the file ID of the barcode, only available with MacroPdf417.

Returns:
The file ID for MacroPdf417

getMacroPdf417SegmentID

public int getMacroPdf417SegmentID()

Gets the segment ID of the barcode,only available with MacroPdf417.

Returns:

getMacroPdf417LastSegment

public boolean getMacroPdf417LastSegment()

Gets the last segment flag,only available with MacroPdf417..

Returns:
True if it's the last segment.

getRegion

public BarCodeRegion getRegion()

Gets the barcode region.

Returns:
The region of the recognized barcode.

getReadType

public BarCodeReadType getReadType()

Gets the barcode type.

Returns:
The type information of the recognized barcode.


Copyright (c) 2002-2012 Aspose Pty Ltd. All Rights Reserved.