Search code examples
androidcameraphotoimagepreview

How to preview full-size when taking photo on Android with hardware.Camera


I'm using android.hardware.Camera to take photos. And this is my settings:

Camera.Parameters p = mCamera.getParameters();

p.setPreviewSize(320, 240);

mCamera.setParameters(p);

And the resolution of my phone is just 320*240,so this is the max preview size.

This picture is what I see in the full screen preview. It's only the left-middle part of the full picture when I take the photo.

enter image description here

And I took a picture at the resolution of 1024*768:
params.setPictureSize(1024, 768);

enter image description here

Can you tell me how to preview the full picture that I'm going to take?


Solution

  • Finally I found the answer.
    This is nothing about settings and nothing about Camera.
    I just didn't set fill_parent in the layout of the SurfaceView!
    Sorry for asking such a stupid question.