使用链接https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/scan-imagedecode-V5\#section387381185013中detectBarcode.decodeImage方法识别二维码,返回结果一直为空。二维码是{"scanResults":[],"zoomValue":1}。
decodeImage需要满足下面两个条件:1、需要确保识别的图片格式是detectBarcode.ImageFormat.NV212、确保识别的图片宽高与相机流的宽高一致。可参考开文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/scan-decodeimage-V5
decodeImage需要满足下面两个条件:
1、需要确保识别的图片格式是detectBarcode.ImageFormat.NV21
2、确保识别的图片宽高与相机流的宽高一致。可参考开文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/scan-decodeimage-V5