简体   繁体   English

如何在Android Vision API中设置全屏显示?

[英]How to set full screen in Android Vision API?

I want to create a barcode scanner that uses full screen. 我想创建一个使用全屏的条形码扫描仪。 I used google's vision API samples that can be found here 我使用了Google的视觉API示例,可在此处找到

This is my result: 这是我的结果:

图片

I want to make a preview of the camera to the full height, how can I do it? 我想将相机预览到全高,该怎么办?

In CameraSourcePreview.java find this if condition and change it to: 在CameraSourcePreview.java中找到此条件,并将其更改为:

if (childHeight < layoutHeight) {
childHeight = layoutHeight;
childWidth = (int)(((float) layoutHeight / (float) height) * width);
}

If you want to match parent for width and height you can use 如果要匹配父项的宽度和高度,可以使用

childHeight = layoutHeight; childWidth = layoutWidth;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM