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);
}
4

1 に答える 1

2

写真を撮りたくない場合は、autofocuscallback から takepicture() を呼び出さないでください。また、ユーザーが画面に触れたポイントに焦点を合わせたい場合は、setFocusAreas() を使用して focusareas を設定できます。

于 2013-05-22T06:19:03.713 に答える