public class BarCodeReader extends Object implements com.aspose.ms.System.IDisposable
BarCodeReader encapsulates an image which may contain one or several barcodes, it then can perform Read operation to detect barcodes
Constructor and Description |
---|
BarCodeReader()
Initializes a new instance of the
BarCodeReader class with default values. |
BarCodeReader(BinarizedBitmap binarizedBitmap)
Initializes a new instance of the
BarCodeReader class. |
BarCodeReader(BinarizedBitmap image,
long type)
Initializes a new instance of the
BarCodeReader class. |
BarCodeReader(BufferedImage image) |
BarCodeReader(BufferedImage image,
long type) |
BarCodeReader(BufferedImage image,
Rectangle area,
long type)
Deprecated.
Initializes a new instance of the |
BarCodeReader(InputStream stream)
Initializes a new instance of the
BarCodeReader class. |
BarCodeReader(InputStream stream,
long type)
Initializes a new instance of the
BarCodeReader class. |
BarCodeReader(InputStream stream,
Rectangle rectangle,
long type)
Initializes a new instance of the
BarCodeReader class. |
BarCodeReader(String filename)
Initializes a new instance of the
BarCodeReader class from file. |
BarCodeReader(String filename,
long type)
Initializes a new instance of the
BarCodeReader class. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes barcode reader.
|
void |
dispose() |
float |
getAngle()
Gets the angle of the barcode (0-360).
|
String |
getCheckSum()
Gets the checksum for 1D barcodes.
|
int |
getChecksumValidation() |
byte[] |
getCodeBytes()
Gets the encoded code bytes.
|
String |
getCodeText()
Gets the code text.
|
String |
getCodeText(Charset encoding)
Gets the code text with encoding.
|
int |
getCustomerInformationInterpretingType()
Gets the Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other.
|
int |
getExpectedBarCodeCount()
Expected barcodes to be found.The reader will stop reading the image once it found barcodes more than this value.
|
int |
getImageBinarizationHints()
Gets the image binarization hints.
|
int |
getMacroPdf417FileID()
Gets the file ID of the barcode, only available with MacroPdf417.
|
int |
getMacroPdf417SegmentID()
Gets the segment ID of the barcode,only available with MacroPdf417.
|
int |
getMacroPdf417SegmentsCount()
Gets macro pdf417 barcode segments count.
|
int |
getMedianSmoothingWindowSize()
Gets the median smoothing window size.
|
int |
getOrientationHints()
Gets the orientation hints.
|
int |
getQRStructuredAppendModeBarCodeIndex()
Gets the index of the QR structured append mode barcode.
|
int |
getQRStructuredAppendModeBarCodesQuantity()
Gets the QR structured append mode barcodes quantity.
|
int |
getQRStructuredAppendModeParityData()
Gets the QR structured append mode parity data.
|
long |
getReadType()
Gets the barcode type.
|
BarCodeRegion |
getRegion()
Gets the barcode region.
|
boolean |
getStripFNC()
Strip FNC1, FNC2, FNC3 characters from codetext.
|
int |
getTimeout()
Gets the timeout of recognition process.
|
static boolean |
isLicensed()
Gets a value indicating whether recognition module is licensed.
|
boolean |
read()
Reads barcode from the image.
|
void |
setBarCodeImage(BufferedImage value)
Sets bitmap image for recognition.
|
void |
setBarCodeImage(String filename)
Sets image file for recogniton.
|
void |
setBarCodeReadType(long type)
Sets BarCodeReadType for recognition.
|
void |
setChecksumValidation(int value) |
void |
setCustomerInformationInterpretingType(int value)
Sets the Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other.
|
void |
setExpectedBarCodeCount(int value)
Expected barcodes to be found.The reader will stop reading the image once it found barcodes more than this value.
|
void |
setImageBinarizationHints(int value)
Sets the image binarization hints.
|
void |
setMedianSmoothingWindowSize(int value)
Sets the median smoothing window size.
|
void |
setOrientationHints(int value)
Sets the orientation hints.
|
void |
setStripFNC(boolean value)
Strip FNC1, FNC2, FNC3 characters from codetext.
|
void |
setTimeout(int value)
Sets the timeout of recognition process.
|
public BarCodeReader()
Initializes a new instance of the BarCodeReader
class with default values.
Requires to set image (SetBitmapImage()) before to call Read() method.
public BarCodeReader(InputStream stream, Rectangle rectangle, long type)
Initializes a new instance of the BarCodeReader
class.
public BarCodeReader(BufferedImage image, Rectangle area, long type)
Initializes a new instance of the BarCodeReader
class.
<b>Not support compact framework.</b>
image
- The image.area
- The area for recognition.type
- The BarCodeReadType.public BarCodeReader(BufferedImage image, long type)
image
- The image.type
- The BarCodeReadType.
Initializes a new instance of the BarCodeReader
class.
<b>Not support compact framework.</b>
public BarCodeReader(BufferedImage image)
image
- The image.
Initializes a new instance of the BarCodeReader
class from an image.
public BarCodeReader(BinarizedBitmap image, long type)
Initializes a new instance of the BarCodeReader
class.
image
- The image.type
- The BarCodeReadType.public BarCodeReader(String filename)
Initializes a new instance of the BarCodeReader
class from file.
filename
- The filename.public BarCodeReader(String filename, long type)
Initializes a new instance of the BarCodeReader
class.
filename
- The filename.type
- The BarCodeReadType.public BarCodeReader(InputStream stream)
Initializes a new instance of the BarCodeReader
class.
stream
- The stream.public BarCodeReader(InputStream stream, long type)
Initializes a new instance of the BarCodeReader
class.
stream
- The stream.type
- The The BarCodeReadType.public BarCodeReader(BinarizedBitmap binarizedBitmap)
Initializes a new instance of the BarCodeReader
class.
binarizedBitmap
- The binarized bitmap.public static boolean isLicensed()
Gets a value indicating whether recognition module is licensed.
Value:true
if recognition module is licensed; otherwise, false
.public int getTimeout()
Gets the timeout of recognition process.
Value: The timeout.public void setTimeout(int value)
Sets the timeout of recognition process.
Value: The timeout.public int getChecksumValidation()
Enable checksum validation during recognition for 1D barcodes.
Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible.
Checksum never used: Codabar
Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN
Checksum always used: Rest symbologies
Value: The checksum validation flag.public void setChecksumValidation(int value)
Enable checksum validation during recognition for 1D barcodes.
Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible.
Checksum never used: Codabar
Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN
Checksum always used: Rest symbologies
Value: The checksum validation flag.public int getMedianSmoothingWindowSize()
Gets the median smoothing window size. Typical values are 3 or 4. Default value is 3. Recognition hint MedianSmoothing must be set.
Value: The median smoothing window size. Typical values are 3 or 4. Default value is 3.public void setMedianSmoothingWindowSize(int value)
Sets the median smoothing window size. Typical values are 3 or 4. Default value is 3. Recognition hint MedianSmoothing must be set.
Value: The median smoothing window size. Typical values are 3 or 4. Default value is 3.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.
public void setExpectedBarCodeCount(int value)
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.
public boolean getStripFNC()
Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.
public void setStripFNC(boolean value)
Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.
public int getCustomerInformationInterpretingType()
Gets the Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other.
public void setCustomerInformationInterpretingType(int value)
Sets the Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other.
public void close()
Closes barcode reader.
public boolean read()
Reads barcode from the image.
public int getOrientationHints()
Gets the orientation hints.
Value: The orientation hints. Default value is NoRotate.public void setOrientationHints(int value)
Sets the orientation hints.
Value: The orientation hints. Default value is NoRotate.public int getImageBinarizationHints()
Gets the image binarization hints.
Value: The image binarization hints. Default value is None.public void setImageBinarizationHints(int value)
Sets the image binarization hints.
Value: The image binarization hints. Default value is None.public String getCodeText()
Gets the code text.
public String getCodeText(Charset encoding)
Gets the code text with encoding.
encoding
- The encoding for codetext.public String getCheckSum()
Gets the checksum for 1D barcodes.
public float getAngle()
Gets the angle of the barcode (0-360). RecognitionHints.Orientation enum does not included into the calculation.
public byte[] getCodeBytes()
Gets the encoded code bytes.
public int getMacroPdf417FileID()
Gets the file ID of the barcode, only available with MacroPdf417.
public int getMacroPdf417SegmentID()
Gets the segment ID of the barcode,only available with MacroPdf417.
public int getMacroPdf417SegmentsCount()
Gets macro pdf417 barcode segments count. Default value is -1.
public int getQRStructuredAppendModeBarCodesQuantity()
Gets the QR structured append mode barcodes quantity. Default value is -1.
public int getQRStructuredAppendModeBarCodeIndex()
Gets the index of the QR structured append mode barcode. Index starts from 0. Default value is -1.
public int getQRStructuredAppendModeParityData()
Gets the QR structured append mode parity data. Default value is -1.
public BarCodeRegion getRegion()
Gets the barcode region.
public long getReadType()
Gets the barcode type.
public void setBarCodeImage(BufferedImage value)
Sets bitmap image for recognition. Must be called before Read() method.
value
- The bitmap image for recognition.public void setBarCodeImage(String filename)
Sets image file for recogniton. Must be called before Read() method.
filename
- The image file for recogniton.public void setBarCodeReadType(long type)
Sets BarCodeReadType for recognition. Must be called before Read() method.
type
- The type of barcode to read.public void dispose()
dispose
in interface com.aspose.ms.System.IDisposable
Copyright (c) 2002-2014 Aspose Pty Ltd. All Rights Reserved.