简体   繁体   English

我如何在android中制作圆形的相机预览?

[英]how can i make camera preview of circle shape in android?

i am making an android app where the camera preview part is circle so that it will only have to capture the face of the user and beside the circle part make other part black.我正在制作一个 android 应用程序,其中相机预览部分是圆形的,这样它只需要捕捉用户的脸,在圆形部分旁边使其他部分变黑。 enter image description here在此处输入图片说明

That would imply making a custom camera yourself instead of using the default one.这意味着自己制作自定义相机,而不是使用默认相机。

Refer to this link for this: https://stackoverflow.com/a/15392209/7528995请参阅此链接: https : //stackoverflow.com/a/15392209/7528995

You could also use the normal camera instead, since making the user fit their head inside the circled preview would be a bit inconvenient.您也可以改用普通相机,因为让用户将头部放入带圆圈的预览中会有点不方便。 After capturing the photo you could simply put it into a CircleImageView .捕获照片后,您可以简单地将其放入CircleImageView

To do this you can refer to this answer: https://stackoverflow.com/a/36613446/7528995为此,您可以参考此答案: https : //stackoverflow.com/a/36613446/7528995

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

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