CustomCameraDemo icon indicating copy to clipboard operation
CustomCameraDemo copied to clipboard

PictureSizes Adaptation Issue

Open gdkid163 opened this issue 9 years ago • 0 comments

Camera.Size previewSize = findPreviewSizeByScreen(p); p.setPreviewSize(previewSize.width, previewSize.height); p.setPictureSize(previewSize.width, previewSize.height);

In the method of setParameters(Camera.Parameters p), there is an exception which can't be caught when application running. The supported PictureSizes of some phones don't contain previewSize got from findPreviewSizeByScreen(p). So we need obtain the supported PictureSizes firstly, and then set proper pictureSize through some algorithm. A simple example,

List<Camera.Size> pictureSizesList = p.getSupportedPictureSizes(); p.setPictureSize(pictureSizesList.get(5).width, pictureSizesList.get(5).height); ...

gdkid163 avatar Mar 01 '16 06:03 gdkid163