Code example for Camera

Methods: getMatrixrestorerotateYsavetranslate

0
     * @param rotationAngle 
     *            the Angle by which to rotate the Bitmap 
     */ 
    private void transformImageBitmap(final ImageView child, final Transformation t, final int rotationAngle)
    { 
        mCamera.save();
        final Matrix imageMatrix = t.getMatrix();
 
        final int height = child.getLayoutParams().height;
 
        final int width = child.getLayoutParams().width;
        final int rotation = Math.abs(rotationAngle);
 
        mCamera.translate(0.0f, 0.0f, 100.0f);
 
        // As the angle of the view gets less, zoom in 
        if (rotation < mMaxRotationAngle) 
        { 
            final float zoomAmount = (float) (mMaxZoom + rotation * 1.5);
            mCamera.translate(0.0f, 0.0f, zoomAmount);
        } 
 
        mCamera.rotateY(rotationAngle);
        mCamera.getMatrix(imageMatrix);
        imageMatrix.preTranslate(-(width / 2.0f), -(height / 2.0f));
        imageMatrix.postTranslate((width / 2.0f), (height / 2.0f));
        mCamera.restore();
    } 
 
    /** 
     * Parses the attributes. 
     *  
Stop searching for code, let great code find you!  Add Codota to your java IDE