{image}

困惑啊!!用zxing读取图片当中的条形码

参考zxing二维码扫描的流程简析(Android版)JavaCodeExamplesforcom。google 。zxing。DecodeHintTypeReadingQRCodewithZxinginJava设置一下TryHarder和PossibleFormats看一下publicstaticListScanForBarcodes(stringpath){returnScanForBarcodes(newBitmap(path));}publicstaticListScanForBarcodes(Bitmapbitmap){//initializeanewBarcodereader。BarcodeReaderreader=newBarcodeReader{TryHarder=true,//TryHarderisslowerbutrecognizesmoreBarcodesPossibleFormats=newList//intheZXingThereisanEnumwhereallsupportedbarcodeFormatswerecontained{BarcodeFormat 。CODE_128,BarcodeFormat。QR_CODE,//BarcodeFormat。 。 。。;}};returnreader。DecodeMultiple(bitmap) 。Select(result=>result。Text)。ToList();//returnonlythebarcodestring 。//IfyouwantthefullResultuse:returnreader。DecodeMultiple(bitmap);}。

本文版权归趣KUAI排www.SEOguruBlog.com 所有,如有转发请注明来出,竞价开户托管,seo优化请联系QQ→61910465