Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2015
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. public static Bitmap rotate(Bitmap bitmap, int degree) {
  2.  
  3.         int w = bitmap.getWidth();
  4.         int h = bitmap.getHeight();
  5.  
  6.         if(w > h){
  7.             Matrix mtx = new Matrix();
  8.             mtx.postRotate(degree);
  9.  
  10.             Bitmap bmp = Bitmap.createBitmap(bitmap, 0, 0, w, h, mtx, true);
  11.  
  12.             return bmp;
  13.         }
  14.  
  15.         return bitmap;
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement