Posted By

arpit on 07/03/11


Tagged

android


Versions (?)

Rotate an image


 / Published in: Java
 

  1. Bitmap bitmapOrg = BitmapFactory.decodeResource(this.getContext().getResources(), R.drawable.moon);
  2. Matrix matrix = new Matrix();
  3. matrix.postRotate(-40);
  4.  
  5. Bitmap resizedBitmap = Bitmap.createBitmap(bitmapOrg, 0, 0,
  6. bitmapOrg.getWidth(), bitmapOrg.getHeight(), matrix, true);
  7. BitmapDrawable bmd = new BitmapDrawable(resizedBitmap);

Report this snippet  

You need to login to post a comment.