Code example for Matrix

Methods: createBitmapsetRotate

    public boolean fromFile() { 
        return mFromFile;
    private static Bitmap rotateImage(Bitmap bitmap, int orientation) {
        if (orientation != 0) {
            // We only rotate the thumbnail once even if we get OOM. 
            Matrix m = new Matrix();
            m.setRotate(orientation, bitmap.getWidth() * 0.5f,
                    bitmap.getHeight() * 0.5f);
            try { 
                Bitmap rotated = Bitmap.createBitmap(bitmap, 0, 0,
                        bitmap.getWidth(), bitmap.getHeight(), m, true);
                // If the rotated bitmap is the original bitmap, then it 
                // should not be recycled. 
                if (rotated != bitmap) bitmap.recycle();
                return rotated;
Connect your IDE to all the code out there  Get Codota for Java