开发者

How to set Zoom in Camera of HTC Sensation?

开发者 https://www.devze.com 2023-03-27 01:03 出处:网络
public void setZoomIn(){ try{ params = camera.getParameters(); zoomValue +=5; params.setZoom(zoomValue); camera.setParameters(params);
public void setZoomIn(){
    try{
        params = camera.getParameters();
        zoomValue +=5;
        params.setZoom(zoomValue);
        camera.setParameters(params);
        Log.d(TAG, "Is support Zoom " + params.isZoomSupported());
    }catch (Exception e) {
        e.printStackTrace();
    }
}

Hi all, the code above successfully set zoom on Camera of Samsung, LG Phone. However, it crashes with HTC Sensation. In HTC Sensation, the default camera application run zoom function开发者_如何学Go wonderfully. I don't know why? Please help me. Thank you so much.


Should you not be checking for the zoom support before you set it?

And in addition check the max zoom limit that the device supports by using 'getMaxZoom()'. This value should act as the upper limit for your set call.

0

精彩评论

暂无评论...
验证码 换一张
取 消