List of utility methods to do Bitmap Rotate
Bitmap | getRotatedBitmap(Bitmap bitmap, int degrees) get Rotated Bitmap if (degrees != 0 && bitmap != null) { Matrix m = new Matrix(); m.setRotate(degrees, (float) bitmap.getWidth() / 2, (float) bitmap.getHeight() / 2); try { Bitmap b2 = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), m, true); if (bitmap.equals(b2)) { ... |
Bitmap | rotateBitmap(Bitmap bitmap, float degrees) rotate Bitmap Bitmap mBitmap = null; try { Matrix m = new Matrix(); m.setRotate(degrees % 360); mBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), m, false); } catch (Exception e) { e.printStackTrace(); ... |
Bitmap | rotateBitmapTranslate(Bitmap bitmap, float degrees) rotate Bitmap Translate Bitmap mBitmap = null; int width; int height; try { Matrix matrix = new Matrix(); if ((degrees / 90) % 2 != 0) { width = bitmap.getWidth(); height = bitmap.getHeight(); ... |
Bitmap | createRotatedBitmap(Bitmap bm, float degree) create Rotated Bitmap Bitmap bitmap = null; if (degree != 0) { Matrix matrix = new Matrix(); matrix.preRotate(degree); bitmap = Bitmap.createBitmap(bm, 0, 0, bm.getWidth(), bm.getHeight(), matrix, true); return bitmap; ... |
Bitmap | RotateBitmap(Bitmap source, float angle) Rotate Bitmap Matrix matrix = new Matrix(); matrix.postRotate(angle); return Bitmap.createBitmap(source, 0, 0, source.getWidth(), source.getHeight(), matrix, true); |