private static Bitmap rotateBitmapInt(Bitmap bitmap,int degrees){
  if (degrees > 0) {
    Matrix matrix=new Matrix();
    matrix.setRotate(degrees);
    Bitmap newBitmap=Bitmap.createBitmap(bitmap,0,0,bitmap.getWidth(),bitmap.getHeight(),matrix,false);
    if (newBitmap != bitmap) {
      bitmap.recycle();
    }
    return newBitmap;
  }
 else {
    return bitmap;
  }
}

private static Bitmap rotateBitmapInt ( Bitmap bitmap , int degrees ) { if ( degrees > 0 ) { Matrix matrix = new Matrix ( ) ; matrix . setRotate ( degrees ) ; Bitmap newBitmap = Bitmap . createBitmap ( bitmap , 0 , 0 , bitmap . getWidth ( ) , bitmap . getHeight ( ) , matrix , false ) ; if ( newBitmap != bitmap ) { bitmap . recycle ( ) ; } return newBitmap ; } else { return bitmap ; } }
rotate the given bitmap by the given degrees . < br > new bitmap is created and the old one is recycled .
