安卓触摸对焦

3

我正在尝试制作一个自定义相机应用程序,让用户触摸屏幕进行对焦,而不是拍照。Android中是否有相关API支持?

public void takePhoto(File photoFile, String workerName, int width, int height,   int        quality) {
if (getAutoFocusStatus()){
    camera.autoFocus(new AutoFocusCallback() {
        @Override
        public void onAutoFocus(boolean success, Camera camera) {
            camera.takePicture(shutterCallback, rawCallback, jpegCallback);
        }
    }); 
}else{
    camera.takePicture(shutterCallback, rawCallback, jpegCallback);
}

this.photoFile = photoFile;
this.workerName = workerName;
this.imageOutputWidth = width;
this.imageOutputHeight = height;
}

public void takePhoto(File photoFile, int width, int height, int quality) {
takePhoto(photoFile, null, width, height, quality);
}
1个回答

2

如果您不想拍照,请勿从自动对焦回调中调用takepicture()。 此外,如果您想要聚焦用户触摸屏幕的点,则可以使用setFocusAreas()设置聚焦区域。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接