Recognize a Barcode
Once your image has been acquired and pre-image processing has been performed to recognize the barcode on the image, the following properties must first be set:
Checks Before Barcode Recognition
- BarcodeInkColor – The default barcode color is black.
- BarcodeOrientation – The default barcode orientation is BC_OrientationBoth.
-
BarcodeType – The type of barcodes you want to detect. The default is all 1D barcodes.
See the BarcodeTypes property for specific identification of barcode types that must be explicitly set to be recognized, and how to speed up barcode detection for known barcode types.
If the barcode image quality is poor (i.e. less than 300 dpi), set the BarcodeTypes property to the specific barcode type in order to obtain accurate results.
- MaxBarcodes – Sets the maximum number of barcodes that will be detected. The default is 100.
If you know how many barcodes you expect to find, set the MaxBarcodes to that value, and Barcode Xpress v7 will stop looking once that number is found.
Once these properties are set, you are ready to recognize the barcode on the image.
Barcode Xpress detects all barcodes in an image and gives you complete details about them.
If you know where on the image the barcodes reside, setting the ReaderAreaHeight, ReaderAreaWidth, ReaderAreaX and ReaderAreaY values to define a smaller rectangular area on your image will speed up processing. By default these values are set to 0 which tells Barcode Xpress to search the entire image automatically.
Supported Barcodes for Recognition
Barcodes supported for recognition are listed in the Overview of Barcode Xpress. The edition you have enabled will determine exact barcodes. To modify editions, see the Trial Mode | Changing BarcodeXpress Edition topic for more information.
Once the BarcodeType has been determined as stated in the Acquire Image topic, use the following methods and properties to recognize the barcode.
Methods
| Method | Description |
| AnalyzehDib | This method detects a barcode within the given DIB. |
| AnalyzeIPicture | This method detects a barcode within the given Picture. |
Properties
| Property | Description |
| BarcodeInkColor | This property gets and sets the ink color of barcodes to search for in recognition. |
| BarcodeOrientation | This property gets and sets the orientation of barcodes to search for in recognition. |
| BarcodeType | This property gets and sets the type of barcodes to search for during recognition. |
| MaxBarcodes | This property gets and sets the maximum number of barcodes to recognize. |
| Picture | This property gets and sets a bitmap for use in barcode recognition. |
| ReaderAreaHeight | This property gets and sets the height of the area for the recognition engine to analyze. |
| ReaderAreaWidth | This property gets and sets the width of the area for the recognition engine to analyze. |
| ReaderAreaX | This property gets and sets the x coordinate of the area for the recognition engine to analyze. |
| ReaderAreaY | This property gets and sets the y coordinate of the area for the recognition engine to analyze. |
See the Overview of Barcode Xpress topic for code examples on recognizing barcodes.
See the Acquire an Image for Barcode Xpress for more code examples.
To obtain the results after analyzing the barcode on an image, See the Access Results topic.
