我想在 zxing 捕获屏幕(相机屏幕)周围放置自定义边框。我需要为此进行什么修改?我需要更改哪些活动和布局才能达到此效果?
您根本不需要编辑布局。
In ViewfinderView
find onDraw
方法。它是绘制“扫描矩形”的核心。您可以按照您想要的方式修改它。
实际绘制矩形的代码可以找到here:
// Draw the exterior (i.e. outside the framing rect) darkened
paint.setColor(resultBitmap != null ? resultColor : maskColor);
canvas.drawRect(0, 0, width, frame.top, paint);
canvas.drawRect(0, frame.top, frame.left, frame.bottom + 1, paint);
canvas.drawRect(frame.right + 1, frame.top, width, frame.bottom + 1, paint);
canvas.drawRect(0, frame.bottom + 1, width, height, paint);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)