4
我想製作一個自定義相機應用程序我想讓用戶可以在此應用程序中選擇焦點模式。Android相機觸摸焦點
對焦模式是默認自動對焦。
如果我想將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);
}