c# - ZXing.Net ITF Barcode issues Windows Phone 8.1 -
i can decode barcodes itf using zxing.net, in cases result.text have missing numbers, in this:
original barcode: 836900000008262500403007233338786038100661049195
result.text : 83690000000 26250040300 23333878603 10066104919
in case there missing 8,7,8 , 5
in other case, numbers reordered random order , have missing numbers:
original barcode: 23793381285017475716618000050809162310000010000
result.text 23791623100000100003381250174757161800005080
ideas why happening?
thanks
edit: 06/12/2015
if don't specify possibleformats decoder decodes codes (the images here:1drv.ms/1b6wd5c) itf , result same described above. code i'm using here:
public barcodereaderservice(idialogservice _dialogservice) { dialogservice = _dialogservice; barcodereader = new barcodereader { options = new decodingoptions { purebarcode = true, tryharder = true, possibleformats = new barcodeformat[] { barcodeformat.itf } }, }; } public async task<string> scanbitmapasync(storagefile file) { string result = null; using (var stream = await file.openreadasync()) { // initialize 1,1 current size of image var writeablebmp = new writeablebitmap(1, 1); writeablebmp.setsource(stream); // , create again because otherwise wb isn't initialized , decoding // results in indexoutofrange writeablebmp = new writeablebitmap(writeablebmp.pixelwidth, writeablebmp.pixelheight); stream.seek(0); writeablebmp.setsource(stream); try { result = scanbitmap(writeablebmp); } catch (exception ex) { dialogservice.showasync("ocorreu um erro \n" + ex.message, "erro"); } } return result != null ? result : null; } private string scanbitmap(writeablebitmap writeablebmp) { var result = barcodereader.decode(writeablebmp); return result != null ? result.text : null; }
the missing numbers indeed validation numbers , have calculated.
Comments
Post a Comment