Here you can find the source of rotation(Bitmap source, int degrees)
public final static Bitmap rotation(Bitmap source, int degrees)
//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; } }