Class BarCodeReader
Reads barcodes from images.
Implements
Inherited Members
Namespace: DRIT.Barcode.Recognition
Assembly: DRIT.Barcode.dll
Syntax
public class BarCodeReader : IDisposable
Constructors
BarCodeReader()
Initializes a new instance of the BarCodeReader class.
Declaration
public BarCodeReader()
BarCodeReader(Bitmap)
Initializes a new instance of the BarCodeReader class with an image.
Declaration
public BarCodeReader(Bitmap image)
Parameters
| Type | Name | Description |
|---|---|---|
| Bitmap | image | The image to read. |
BarCodeReader(Bitmap, params BaseDecodeType[])
Initializes a new instance of the BarCodeReader class with an image and decode types.
Declaration
public BarCodeReader(Bitmap image, params BaseDecodeType[] decodeTypes)
Parameters
| Type | Name | Description |
|---|---|---|
| Bitmap | image | The image to read. |
| BaseDecodeType[] | decodeTypes | The decode types to attempt. |
BarCodeReader(Bitmap, Rectangle, params BaseDecodeType[])
Initializes a new instance of the BarCodeReader class with an image, area, and decode types.
Declaration
public BarCodeReader(Bitmap image, Rectangle area, params BaseDecodeType[] decodeTypes)
Parameters
| Type | Name | Description |
|---|---|---|
| Bitmap | image | The image to read. |
| Rectangle | area | The region to search within. |
| BaseDecodeType[] | decodeTypes | The decode types to attempt. |
BarCodeReader(Bitmap, Rectangle[], params BaseDecodeType[])
Initializes a new instance of the BarCodeReader class with an image, areas, and decode types.
Declaration
public BarCodeReader(Bitmap image, Rectangle[] areas, params BaseDecodeType[] decodeTypes)
Parameters
| Type | Name | Description |
|---|---|---|
| Bitmap | image | The image to read. |
| Rectangle[] | areas | The regions to search within. |
| BaseDecodeType[] | decodeTypes | The decode types to attempt. |
BarCodeReader(Stream)
Initializes a new instance of the BarCodeReader class from a stream.
Declaration
public BarCodeReader(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream to read from. |
BarCodeReader(Stream, params BaseDecodeType[])
Initializes a new instance of the BarCodeReader class from a stream with decode types.
Declaration
public BarCodeReader(Stream stream, params BaseDecodeType[] decodeTypes)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream to read from. |
| BaseDecodeType[] | decodeTypes | The decode types to attempt. |
BarCodeReader(string)
Initializes a new instance of the BarCodeReader class from a file.
Declaration
public BarCodeReader(string imageFile)
Parameters
| Type | Name | Description |
|---|---|---|
| string | imageFile | The image file to read. |
BarCodeReader(string, params BaseDecodeType[])
Initializes a new instance of the BarCodeReader class from a file with decode types.
Declaration
public BarCodeReader(string imageFile, params BaseDecodeType[] decodeTypes)
Parameters
| Type | Name | Description |
|---|---|---|
| string | imageFile | The image file to read. |
| BaseDecodeType[] | decodeTypes | The decode types to attempt. |
Properties
DecodeTypes
Gets or sets the decode types to attempt during recognition.
Declaration
public BaseDecodeType[] DecodeTypes { get; set; }
Property Value
| Type | Description |
|---|---|
| BaseDecodeType[] |
FoundBarCodes
Gets the barcodes found in the last call to ReadBarCodes().
Declaration
public BarCodeResult[] FoundBarCodes { get; }
Property Value
| Type | Description |
|---|---|
| BarCodeResult[] |
ProcessorSettings
Gets the processor settings controlling multi-threading.
Declaration
public static ProcessorSettings ProcessorSettings { get; }
Property Value
| Type | Description |
|---|---|
| ProcessorSettings |
QualitySettings
Gets or sets the quality settings controlling the speed/accuracy trade-off.
Declaration
public QualitySettings QualitySettings { get; set; }
Property Value
| Type | Description |
|---|---|
| QualitySettings |
Timeout
Gets or sets the recognition timeout in milliseconds. Zero means no timeout.
Declaration
public int Timeout { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
ReadBarCodes()
Reads all barcodes from the image.
Declaration
public BarCodeResult[] ReadBarCodes()
Returns
| Type | Description |
|---|---|
| BarCodeResult[] | The recognized barcodes. |
SetBarCodeImage(Bitmap)
Sets the image to read from a bitmap.
Declaration
public void SetBarCodeImage(Bitmap value)
Parameters
| Type | Name | Description |
|---|---|---|
| Bitmap | value | The bitmap image. |
SetBarCodeImage(Stream)
Sets the image to read from a stream.
Declaration
public void SetBarCodeImage(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream to read from. |
SetBarCodeImage(string)
Sets the image to read from a file.
Declaration
public void SetBarCodeImage(string imageFile)
Parameters
| Type | Name | Description |
|---|---|---|
| string | imageFile | The image file path. |
SetBarCodeRegion(Rectangle)
Sets the region to search within.
Declaration
public void SetBarCodeRegion(Rectangle region)
Parameters
| Type | Name | Description |
|---|---|---|
| Rectangle | region | The region to search. |
SetBarCodeRegions(Rectangle[])
Sets the regions to search within.
Declaration
public void SetBarCodeRegions(Rectangle[] regions)
Parameters
| Type | Name | Description |
|---|---|---|
| Rectangle[] | regions | The regions to search. |