Here you can find the source of createRotatedBitmap(Bitmap bm, float degree)
public static Bitmap createRotatedBitmap(Bitmap bm, float degree)
//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; } }