Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当 Android 相机打开时,它会在宽度和高度上填满屏幕,但实际上我希望应用程序打开并限制屏幕上的某些尺寸,即条形码扫描仪,但这里要注意的是,拍摄的图像应该限制矩形的边界该应用程序显示在其表面上。
这可能吗?
首先:该应用程序是开源的,因此请随时检查他们在做什么:
谷歌代码项目
如果我有一个猜测,我会说他们用另一个视图覆盖相机预览(例如,通过 addContentView())并在图像回调后裁剪相机/预览图像。所以这绝对是可能的,你必须手动裁剪图像(根据框架)。