Android examples for Graphics:Bitmap Rotate
Rotates a Bitmap by angle degrees
//package com.java2s; import android.graphics.Bitmap; import android.graphics.Matrix; public class Main { /**// w w w . j a va2 s .co m * Rotates a <code>Bitmap</code> by <code>angle</code> degrees * * @param original Bitmap to rotate * @param angle Angle to rotate * @return Rotated Bitmap */ public static Bitmap getRotatedFor(Bitmap original, int angle) { int w = original.getWidth(); int h = original.getHeight(); Matrix mtx = new Matrix(); mtx.postRotate(angle); return Bitmap.createBitmap(original, 0, 0, w, h, mtx, true); } }