Code example for Camera.Parameters

Methods: setRotation

0
        _mySurfaceHolder = theSurfaceView.getHolder();
        _mySurfaceHolder.setType( SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS );
        _mySurfaceHolder.addCallback( this );
        _myCamera = Camera.open();
        Parameters params = _myCamera.getParameters();
        params.setRotation(90);
        _myCamera.setParameters(params);
        if ( _myCamera == null ) {
            AC_Log.print( "CameraTexture: Camera is null" ); 
            return; 
        } 
        try { 
            _myCamera.setPreviewDisplay( _mySurfaceHolder );
        } catch ( Throwable t ) {
            AC_Log.print( "CameraTexture: Exception in setPreviewDisplay()"); 
        } 
        _myCamWidth = _myCamera.getParameters().getPreviewSize().width;
        _myCamHeight= _myCamera.getParameters().getPreviewSize().height;
        _myTextureWidth = (int) Math.pow( 2,(int)( Math.log(_myCamWidth) / Math.log(2) ) + 1);
        _myTextureHeight = (int) Math.pow( 2, (int)(Math.log(_myCamHeight) / Math.log(2) ) + 1);
Contextual code suggestions in your IDE  Get Codota for Java