Well I have got a code for you, just try adjusting the width and the height of the image that you have clicked with this code and then see if you are getting the appropriate result.
Code:
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
try{
Camera.Parameters param = mCamera.getParameters();
mCamera.setPreviewDisplay(camaSurfaceHolder);
int widPi = dm.widPi;
int heiPi = dm.heiPi;
try{
param.setPreviewSize(widPi, heiPi);
param.setPictureSize(widPi, heiPi);
} catch (Exception e){
Log.e(TAG, e.getMessage());
}
mCamera.setParameters(param);
mCamera.startPreview();
} catch (IOException e){
Log.e(TAG, e.getMessage());
}
}
Just try out with the above coding and let me know if it works or not.
Bookmarks