Set camera resolution

suggest change

Set a high resolution programmatically. The loop keeps the last supported size, which is not necessarily the highest. TAG is not declared. An empty list leaves mSize null.

Camera 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 = null;
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);

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents