Android Bitmap Rotate createRotatedBitmap(Bitmap bm, float degree)

Here you can find the source of createRotatedBitmap(Bitmap bm, float degree)

Description

create Rotated Bitmap

License

Apache License

Declaration

public static Bitmap createRotatedBitmap(Bitmap bm, float degree) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import android.graphics.Bitmap;

import android.graphics.Matrix;

public class Main {
    public static Bitmap createRotatedBitmap(Bitmap bm, float degree) {
        Bitmap bitmap = null;//from   w  w  w .jav a  2s  .  c om
        if (degree != 0) {
            Matrix matrix = new Matrix();
            matrix.preRotate(degree);
            bitmap = Bitmap.createBitmap(bm, 0, 0, bm.getWidth(),
                    bm.getHeight(), matrix, true);
        }

        return bitmap;
    }
}

Related

  1. rotateBitmap(Bitmap source, int rotation, boolean recycle)
  2. rotateBitmap(Bitmap b, int degrees)
  3. getRotatedBitmap(Bitmap bitmap, int degrees)
  4. rotateBitmap(Bitmap bitmap, float degrees)
  5. rotateBitmapTranslate(Bitmap bitmap, float degrees)
  6. RotateBitmap(Bitmap source, float angle)