CWAC相机 - 添加水龙头可以聚焦吗?

时间:2023-01-27 18:55:33

I'm using the commonsware camera library. My pictures look great, but when I get close to something I want to re-focus, but I haven't been able to do that. I have followed some of the read me documentation as seen here:

我正在使用commonsware相机库。我的照片看起来很棒,但是当我接近我要重新聚焦的东西时,我却无法做到这一点。我已经按照这里看到的一些自述文档:

You can call autoFocus() on CameraFragment or CameraView to trigger any auto-focus behavior that you have configured via setFocusMode() on Camera.Parameters. You can call cancelAutoFocus() on CameraFragment or CameraView to ensure that auto-focus mode has been canceled.

您可以在CameraFragment或CameraView上调用autoFocus()来触发您在Camera.Parameters上通过setFocusMode()配置的任何自动对焦行为。您可以在CameraFragment或CameraView上调用cancelAutoFocus()以确保已取消自动对焦模式。

I'm simply doing an onclicklistener on the screen, and want it to focus again, so that my picture is clear. Has anyone been successful in doing this?

我只是在屏幕上做一个onclicklistener,并希望它再次聚焦,以便我的图片清晰。有没有人成功这样做?

1 个解决方案

#1


5  

Apparently, you need to cancelAutoFocus() before you can trigger autoFocus() again to get a fresh autofocus.

显然,您需要先取消AutoFocus(),然后才能再次触发autoFocus()以获得新的自动对焦。

I have filed an issue with, um, myself, to consider a better API here.

我已经提交了一个问题,嗯,我自己,在这里考虑更好的API。

#1


5  

Apparently, you need to cancelAutoFocus() before you can trigger autoFocus() again to get a fresh autofocus.

显然,您需要先取消AutoFocus(),然后才能再次触发autoFocus()以获得新的自动对焦。

I have filed an issue with, um, myself, to consider a better API here.

我已经提交了一个问题,嗯,我自己,在这里考虑更好的API。