Exemplo n.º 1
0
 public Detector()
 {
     _Reader = new ZXing.BarcodeReaderGeneric();
     _Reader.Options.PureBarcode = false;
     _Reader.Options.Hints.Add(ZXing.DecodeHintType.TRY_HARDER, true);
     _Reader.Options.PossibleFormats = new ZXing.BarcodeFormat[] { ZXing.BarcodeFormat.QR_CODE };
     _Reader.Options.TryHarder       = true;
 }
Exemplo n.º 2
0
        public static ZXing.Result ScanAndDecodeQRCode <TPixel>(this SpanBitmap <TPixel> src)
            where TPixel : unmanaged
        {
            var reader = new ZXing.BarcodeReaderGeneric();

            reader.Options.PureBarcode = false;
            reader.Options.Hints.Add(ZXing.DecodeHintType.TRY_HARDER, true);
            reader.Options.PossibleFormats = new ZXing.BarcodeFormat[] { ZXing.BarcodeFormat.QR_CODE };
            reader.Options.TryHarder       = true;

            Byte[] buffer = null;

            _TempBuffer?.TryGetTarget(out buffer);

            var luminance = _Implementation.CreateLuminanceSource(src, ref buffer);

            _TempBuffer = new WeakReference <byte[]>(buffer);

            return(reader.Decode(luminance));
        }