基于 Zing, 初学android 代码质量可能不高
bigImage.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View viewm) {
Bitmap obmp = ((BitmapDrawable) (bigImage).getDrawable()).getBitmap();
int width = obmp.getWidth();
int height = obmp.getHeight();
int[] data = new int[width * height];
obmp.getPixels(data, 0, width, 0, 0, width, height);
RGBLuminanceSource source = new RGBLuminanceSource(width, height, data);
BinaryBitmap bitmap1 = new BinaryBitmap(new HybridBinarizer(source));
QRCodeReader reader = new QRCodeReader();
Result re = null;
try {
re = reader.decode(bitmap1);
} catch (NotFoundException e) {

这篇博客介绍了如何在Android应用中实现长按图片识别二维码的功能,利用Zing库进行解析,适合初学者了解相关实现。
最低0.47元/天 解锁文章
564

被折叠的 条评论
为什么被折叠?



