Once your image has been acquired and pre-image processing has been performed to recognize the barcode on the image, you can set the following properties:
Checks Before Barcode Recognition
If possible, set the following properties before starting the detection process:
Property | Description |
---|---|
InkColor | The default barcode color is black. |
Orientation | The default barcode orientation is horizontal/vertical orientations. |
BarcodeTypes | 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 to obtain accurate results. |
MaximumBarcodes | 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 MaximumBarcodes to that value, and Barcode Xpress 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 Area 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 Barcode Xpress Overview.
Once the BarcodeTypes property has been determined, use the following methods and properties to recognize the barcode.
Methods
Method | Description |
---|---|
Analyze(System.Drawing.Bitmap) | Detects barcodes within the given bitmap image. |
Properties
Property | Description |
---|---|
AdditionalReadingPass | Gets and sets a value which determines if an additional processing pass will be performed on a scaled (reduced) version of the original image. |
AppendCheckSum | Gets and sets a value which determines if a checksum value is appended to the barcode during recognition. |
Area | Gets and sets the area of the image, in pixels, to analyze for barcode recognition. |
AustralianPostCustomDecodeMode | Gets and sets the AustrailianPostCustomDecodeType. |
BarcodeTypes | Gets and sets the type of barcodes to analyze during recognition processing. |
IncludeControlCharacters | Gets and sets the control characters in the barcode value during recognition processing. |
InkColor | Gets and sets the ink color of barcodes to search for during recognition processing. |
MaximumBarcodes | Gets and sets the maximum number of barcodes to recognize. |
Orientation | Gets and sets the orientation of the barcodes to analyze during recognition. |
ReturnPossibleBarcodes | Gets and sets a value to determine if possible barcodes are returned in the result list. |
GrayscaleProcessing Property | Gets and sets a value which determines if grayscale processing will be performed on images that are 8bpp or 24bpp. |
RoyalMailVariableLengthDecoding | Specifies whether or not to decode Royal Mail barcodes of any length. If set to false, only Royal Mail barcodes matching the lengths in the RM4SCC specification will be decoded. |
C# - Minimum C# code to recognize barcodes in an image using Accusoft.BarcodeXpress13.NetCore
// Instantiate BarcodeXpress object.
BarcodeXpress bcx = new BarcodeXpress();
// The SetSolutionName and SetSolutionKey methods must be called to distribute the runtime.
bcx.Licensing.SetSolutionName("YourSolutionName");
bcx.Licensing.SetSolutionKey(12345,12345,12345,12345);
// The SetOEMLicenseKey is required if Manually Reported Runtime Licensing is used.
bcx.Licensing.SetOEMLicenseKey("1.0.AStringForOEMLicensing");
// Call Analyze to detect barcodes in the image
// all detected barcodes will be returned to the
// Result object array.
Result[] results = bcXpress.reader.Analyze(bitmap);
// Get results info.
for (short i = 0; i < results.Length; i++)
{
// Get result for current barcode.
Result curResult = (Result)results.GetValue(i);
// Do something with results.
Console.WriteLine(curResult.BarcodeName);
Console.WriteLine(curResult.BarcodeValue);
}
To obtain the results after analyzing the barcode on an image, see the Access Results topic.