Skip to content

PictureSizes Adaptation Issue #1

@gdkid163

Description

@gdkid163

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);
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions