Android Bitmap Rotate rotation(Bitmap source, int degrees)

Here you can find the source of rotation(Bitmap source, int degrees)

Description

rotation

Declaration

public final static Bitmap rotation(Bitmap source, int degrees) 

Method Source Code

//package com.java2s;

import android.graphics.Bitmap;

import android.graphics.Matrix;

public class Main {
    public final static Bitmap rotation(Bitmap source, int degrees) {
        if (null == source || source.isRecycled()) {
            return null;
        }//from  w  w w .  j a v a 2 s. c  om

        Matrix matrix = new Matrix();
        matrix.postRotate(degrees);
        Bitmap rotation = Bitmap.createBitmap(source, 0, 0,
                source.getWidth(), source.getHeight(), matrix, true);
        if (rotation != null) {
            source.recycle();
        }
        return rotation;
    }
}

Related

  1. rotateAndMirror(Bitmap b, int degrees, boolean mirror)
  2. rotateBitmap(Bitmap b, int degrees)
  3. rotateBitmap(Bitmap source, float angle)
  4. rotateBitmap(Bitmap source, int rotation, boolean recycle)
  5. rotatePic(Bitmap bitmap, int degree)
  6. GetRotatedBitmap(Bitmap bitmap, int degrees)
  7. computePictureRotation()
  8. GetExifOrientation(String filepath)
  9. reflectionFromBitmap(Bitmap originalBitmap, boolean isFuzzy)