android 二维码扫描(zxing使用小结),android开发基础入门

本文介绍了在Android中使用zxing库进行二维码扫描的基本步骤,并讨论了如何调整扫描框位置以适应不同屏幕尺寸,以及解决扫描框内图片变形的问题。在CameraConfigurationManager中设置相机参数,以确保正确的预览大小和防止图像失真。文章最后鼓励初学者多练习,提高编程技能。
摘要由CSDN通过智能技术生成

Collection currentPossible = possibleResultPoints;

Collection currentLast = lastPossibleResultPoints;

if (currentPossible.isEmpty()) {

lastPossibleResultPoints = null;

} else {

possibleResultPoints = new HashSet(5);

lastPossibleResultPoints = currentPossible;

paint.setAlpha(OPAQUE);

paint.setColor(resultPointColor);

for (ResultPoint point : currentPossible) {

canvas.drawCircle(frame.left + point.getX(), frame.top

  • point.getY(), 6.0f, paint);

}

}

if (currentLast != null) {

paint.setAlpha(OPAQUE / 2);

paint.setColor(resultPointColor);

for (ResultPoint point : currentLast) {

canvas.drawCircle(frame.left + point.getX(), frame.top

  • point.getY(), 3.0f, paint);

}

}

//只刷新扫描框的内容,其他地方不刷新

postInvalidateDelayed(ANIMA

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值