Class BarcodeReader<T>
- Namespace
- ZXing
- Assembly
- zxing.dll
A smart class to decode the barcode inside a bitmap object
public class BarcodeReader<T> : BarcodeReaderGeneric, IBarcodeReaderGeneric, IBarcodeReader<T>
Type Parameters
T
- Inheritance
-
BarcodeReader<T>
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
BarcodeReader(Func<T, LuminanceSource>)
Initializes a new instance of the BarcodeReader<T> class.
public BarcodeReader(Func<T, LuminanceSource> createLuminanceSource)
Parameters
createLuminanceSource
Func<T, LuminanceSource>
BarcodeReader(Reader, Func<LuminanceSource, Binarizer>, Func<byte[], int, int, BitmapFormat, LuminanceSource>)
Constructor for additional image formats for one BarcodeReader class
protected BarcodeReader(Reader reader, Func<LuminanceSource, Binarizer> createBinarizer, Func<byte[], int, int, RGBLuminanceSource.BitmapFormat, LuminanceSource> createRGBLuminanceSource)
Parameters
reader
ReaderSets the reader which should be used to find and decode the barcode. If null then MultiFormatReader is used
createBinarizer
Func<LuminanceSource, Binarizer>Sets the function to create a binarizer object for a luminance source. If null then HybridBinarizer is used
createRGBLuminanceSource
Func<byte[], int, int, RGBLuminanceSource.BitmapFormat, LuminanceSource>Sets the function to create a luminance source object for a rgb raw byte array.
BarcodeReader(Reader, Func<T, LuminanceSource>, Func<LuminanceSource, Binarizer>)
Initializes a new instance of the BarcodeReader<T> class.
public BarcodeReader(Reader reader, Func<T, LuminanceSource> createLuminanceSource, Func<LuminanceSource, Binarizer> createBinarizer)
Parameters
reader
ReaderSets the reader which should be used to find and decode the barcode. If null then MultiFormatReader is used
createLuminanceSource
Func<T, LuminanceSource>Sets the function to create a luminance source object for a bitmap. If null, an exception is thrown when Decode is called
createBinarizer
Func<LuminanceSource, Binarizer>Sets the function to create a binarizer object for a luminance source. If null then HybridBinarizer is used
BarcodeReader(Reader, Func<T, LuminanceSource>, Func<LuminanceSource, Binarizer>, Func<byte[], int, int, BitmapFormat, LuminanceSource>)
Initializes a new instance of the BarcodeReader<T> class.
public BarcodeReader(Reader reader, Func<T, LuminanceSource> createLuminanceSource, Func<LuminanceSource, Binarizer> createBinarizer, Func<byte[], int, int, RGBLuminanceSource.BitmapFormat, LuminanceSource> createRGBLuminanceSource)
Parameters
reader
ReaderSets the reader which should be used to find and decode the barcode. If null then MultiFormatReader is used
createLuminanceSource
Func<T, LuminanceSource>Sets the function to create a luminance source object for a bitmap. If null, an exception is thrown when Decode is called
createBinarizer
Func<LuminanceSource, Binarizer>Sets the function to create a binarizer object for a luminance source. If null then HybridBinarizer is used
createRGBLuminanceSource
Func<byte[], int, int, RGBLuminanceSource.BitmapFormat, LuminanceSource>Sets the function to create a luminance source object for a rgb raw byte array.
Properties
CreateLuminanceSource
Optional: Gets or sets the function to create a luminance source object for a bitmap. If null a platform specific default LuminanceSource is used
protected Func<T, LuminanceSource> CreateLuminanceSource { get; }
Property Value
- Func<T, LuminanceSource>
The function to create a luminance source object.
Methods
Decode(T)
Decodes the specified barcode bitmap.
public Result Decode(T barcodeBitmap)
Parameters
barcodeBitmap
TThe barcode bitmap.
Returns
- Result
the result data or null
DecodeMultiple(T)
Decodes the specified barcode bitmap.
public Result[] DecodeMultiple(T barcodeBitmap)
Parameters
barcodeBitmap
TThe barcode bitmap.
Returns
- Result[]
the result data or null