In my app, I was able to run a code using the camera class to take pictures, but it gives me 2048 x 1536 pixels as the image size.
When I use the default camera of m
You can use setPictureSize() on the camera parameters object to configure the size of the capture:
http://developer.android.com/reference/android/hardware/Camera.Parameters.html#setPictureSize(int, int)
Generally speaking first you should call getSupportedPictureSizes() to make sure you're asking for a resolution that the hardware supports, but sounds like you already know the sizes.
put this code
Parameters parameters = camera.getParameters();
parameters.set("jpeg-quality", 70);
parameters.setPictureFormat(PixelFormat.JPEG);
parameters.setPictureSize(2048, 1232);
camera.setParameters(parameters);
in your surfaceCreated function after calling
camera = Camera.open();
you have found your solution...
en Click here
ch Click here
I have same problem in my work. I use that to solution my problem.
for example i use undercode in my SurfaceView(CameraPreview)
Camera.Parameters parameters = camera.getParameters();
pictureSize = MyCamPara.getInstance().getPictureSize(
parameters.getSupportedPictureSizes(), 800);
previewSize = MyCamPara.getInstance().getPreviewSize(
parameters.getSupportedPreviewSizes(), getHeight());
if (previewSize != null)
parameters
.setPreviewSize(previewSize.width, previewSize.height);
if (pictureSize != null)
parameters
.setPictureSize(pictureSize.width, pictureSize.height);
camera.setPreviewDisplay(holder);
camera.setParameters(parameters);
camera.startPreview();