Aspose.BarCode.BarCodeRecognition Namespace
The Aspose.BarCode.BarCodeRecognition contains tools for the 1D/2D barcodes recognition.
Classes
  ClassDescription
Public classCode exampleBarCodeReader
BarCodeReader encapsulates an image which may contain one or several barcodes, it then can perform Read operation to detect barcodes.
Examples
This sample shows how to detect Code39 barcode with supplement.
[C#]
using(BarCodeReader reader = new BarCodeReader(@"c:\test.jpg", DecodeType.Code39Standard))
{
    while(reader.Read())
    {
        Console.WriteLine("BarCode Type: " + reader.GetCodeType());
        Console.WriteLine("BarCode CodeText: " + reader.GetCodeText());
    }
}
[VB.NET]
Using reader As BarCodeReader = New BarCodeReader("c:\test.jpg", DecodeType.Code39Standard)
    While reader.Read()
        Console.WriteLine("BarCode Type: " + reader.GetCodeTypeName())
        Console.WriteLine("BarCode CodeText: " + reader.GetCodeText())
    End While
End Using
Public classBarCodeRecognitionException
General exception thrown by BarCodeReader, inherited from BarCodeException
Public classCode exampleBarCodeRegion
Represents the barcode's region.
Public classBaseDecodeType
Base class for MultyDecodeType and SingleDecodeType.
Public classCode128DataPortion
Contains the data of subtype for Code128 type barcode
Public classCode exampleDecodeType
Specify the type of barcode to read.
Examples
This sample shows how to detect Code39 and Code128 barcode.
[C#]
using (BarCodeReader reader = new BarCodeReader(@"c:\test.jpg", DecodeType.Code39Standard, DecodeType.Code128))
{
    while (reader.Read())
    {
          Console.WriteLine("BarCode Type: " + reader.GetCodeType());
          Console.WriteLine("BarCode CodeText: " + reader.GetCodeText());
    }
}
[VB.NET]
Using reader As BarCodeReader = New BarCodeReader("c:\test.jpg", DecodeType.Code39Standard, DecodeType.Code128)
    While reader.Read()
    Console.WriteLine("BarCode Type: " + reader.GetCodeTypeName())
    Console.WriteLine("BarCode CodeText: " + reader.GetCodeText())
    End While
End Using
Public classCode exampleMultyDecodeType
Composite decode type.
Public classCode exampleQualitySettings
QualitySettings allows to configure recognition quality and speed manually. You can quickly set up QualitySettings by embedded presets: HighPerformance, NormalQuality, HighQuality, MaxBarCodes or you can manually configure separate options. Default value of QualitySettings is NormalQuality.
Examples
This sample shows how to use QualitySettings with BarCodeReader
[C#]
using (BarCodeReader reader = new BarCodeReader(@"c:\test.jpg"))
{
   //set high performance mode
   reader.QualitySettings = QualitySettings.HighPerformance;
   while (reader.Read())
       Console.WriteLine("BarCode CodeText: " + reader.GetCodeText());
}
using (BarCodeReader reader = new BarCodeReader(@"c:\test.jpg"))
{
   //set high performance mode
   reader.QualitySettings = QualitySettings.HighPerformance;
   //set separate options
   reader.QualitySettings.AllowMedianSmoothing = true;
   reader.QualitySettings.MedianSmoothingWindowSize = 5;
   while (reader.Read())
       Console.WriteLine("BarCode CodeText: " + reader.GetCodeText());
}
using (BarCodeReader reader = new BarCodeReader(@"c:\test.jpg"))
{
   //default mode is NormalQuality
   //set separate options
   reader.QualitySettings.AllowMedianSmoothing = true;
   reader.QualitySettings.MedianSmoothingWindowSize = 5;
   while (reader.Read())
       Console.WriteLine("BarCode CodeText: " + reader.GetCodeText());
}
Public classCode exampleSingleDecodeType
Single decode type. See decode type to get instance.
Interfaces
  InterfaceDescription
Public interfaceICOMBarCodeReader
Interface for COM interop usage.
Enumerations
  EnumerationDescription
Public enumerationChecksumValidation

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

Public enumerationCode128SubType
Contains types of Code128 subset
Public enumerationManualHint Obsolete.
Manual hints.
Public enumerationRecognitionMode Obsolete.
Recognition modes. Note: only one recognition mode can be selected.