Setting camera image size in Android

后端 未结 2 2001
傲寒
傲寒 2020-12-16 03:12

At the moment I am attempting to set my camera on my Motorola Droid phone to take an image that matches the size of my screen (854 x 480 pixels), and I am attempting to acco

相关标签:
2条回答
  • 2020-12-16 03:45

    I have found the answer, apparently my own screen resolution is not a supported size for the camera. I was not aware of the camera only being able to support certain sizes as I am programming with the 1.6 SDK.

    Is there any way to retrieve the supported sizes of the camera for 1.5/1.6?

    0 讨论(0)
  • 2020-12-16 04:01

    Yes there are methods provided to get the picture sizes supported by camera. The method the paramters class of camera which provides the supported picture sizes by camera is getSupportedPictureSizes(); Using this method, you can get the supported size by camera. The code snippet would look like this:-

    Camera camera = Camera.open();
    Parameters params = camera.getParameters();
    List<Camera.Size> sizes = params.getSupportedPictureSizes();
    

    I hope this will help you.

    Thanks Nawab

    0 讨论(0)
提交回复
热议问题