我正在尝试制作一个自定义相机应用程序,我希望用户可以在此应用程序中选择对焦模式。
默认情况下,对焦模式是自动对焦。
如果我想将cameraView设置为可点击,使得当我触摸屏幕上的某一点时,相机的对焦点在该点上,我应该从哪里开始呢?以下是我的代码:
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);
}