this is mt code for take picture in surfaceView:
@Override
public void surfaceCreated(SurfaceHolder holder) {
mCamera = Camera.open();
try {
mCamera.setPreviewDisplay(holder);
mCamera.setDisplayOrientation(90);
} catch (IOException exception) {
mCamera.release();
mCamera = null;
}
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width,
int height) {
Camera.Parameters params = mCamera.getParameters();
Camera.Size result = getBestPreviewSize(params, width, height);
params.setPreviewSize(result.width, result.height);
params.setPictureFormat(ImageFormat.JPEG);
params.setJpegQuality(100);
mCamera.setParameters(params);
mCamera.startPreview();
}
the preview of picture is in portrait mode, but picture is saved on my storage rotated. How can i save picture with the same orientation of preview ?