Im using Zxing.net with c# to decode 1D and 2D codes. For some reason the BarcodeReader method does not accept Binarybitmap, it only accepts a normal bitmap. I want to use binary bitmap because zxing has an inbuilt binarizer function.
Here is my code:
public void ProcessCode(Bitmap image, BarcodeFormat format)
{
LuminanceSource source;
source = new ZXing.BitmapLuminanceSource(image);
var bitmapr = new BinaryBitmap(new GlobalHistogramBinarizer (source));
var bcreader = new BarcodeReader { AutoRotate = false };
bcreader.Options.PossibleFormats = new List<BarcodeFormat>();
bcreader.Options.PossibleFormats.Add(QrCode);
result = bcreader.Decode(bitmapr);
resultp = result.ResultPoints;
}
The error I get is : cannot convert from 'ZXing.BinaryBitmap' to 'System.Drawing.Bitmap'