我正在尝试制作一个自定义相机应用程序,我想让用户可以在此应用程序中选择对焦模式。
对焦模式默认为自动对焦。
如果我想将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);
}