I have built a custom Camera App and I am trying to change the resoloution of the image that is took. I have read around that this could depend on the phone or version of An
There is no setResolution()
, only setPictureSize()
. Use getSupportedPictureSizes()
on Camera.Parameters
to find the size you want, or use that information to populate a ListView
or Spinner
or something for the user to choose the desired size. Here is a sample project recently updated to use getSupportedPictureSizes()
to find the smallest supported resolution and use that.
It's too easy to capture image with high quality, here you can set your own resolution:
mCamera = Camera.open();
Camera.Parameters params = mCamera.getParameters();
// Check what resolutions are supported by your camera
List<Size> sizes = params.getSupportedPictureSizes();
// Iterate through all available resolutions and choose one.
// The chosen resolution will be stored in mSize.
Size mSize;
for (Size size : sizes) {
Log.i(TAG, "Available resolution: "+size.width+" "+size.height);
mSize = size;
}
}
Log.i(TAG, "Chosen resolution: "+mSize.width+" "+mSize.height);
params.setPictureSize(mSize.width, mSize.height);
mCamera.setParameters(params);
Hope this will help you all.