//*************************
// Auto Focus後に画像を保存
//*************************
private Camera.AutoFocusCallback mAutoFocusListener =
new Camera.AutoFocusCallback() {
public void onAutoFocus(boolean success, final Camera camera)
{
Log.v(TAG, "AutoFocued");
//camera.autoFocus(null); //これがあるとフォーカスのとれた画像が取れない
camera.takePicture(null, null, jpgList);
}
};
private PictureCallback jpgList = new PictureCallback() {
public void onPictureTaken(byte[] data, Camera camera)
{
if (data != null)
{
//JPEGdataそのままファイル保存
_path = DATA_PATH + "ocr.jpg";
try {
FileOutputStream foStream = new FileOutputStream(_path);
foStream.write(data);
foStream.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
camera.startPreview();
return;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
camera.startPreview();
return;
}
Log.v(TAG, "onPictureTaken");
}
camera.startPreview();
}
};