Android Camera Image Size

后端 未结 3 1076
清歌不尽
清歌不尽 2020-12-30 06:19

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

3条回答
  •  醉梦人生
    2020-12-30 07:19

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

提交回复
热议问题