{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);}。