Posted By

cruddell001 on 12/09/13


Tagged


Versions (?)

Resize Drawable Image


 / Published in: Java
 

  1. ////////////////////////////////////////////////////
  2. //resize drawable image
  3. ////////////////////////////////////////////////////
  4. public Drawable resize(Drawable image, int theWidth, int theHeight) {
  5. BT_debugger.showIt(activityName + ": method resize called");
  6. BT_debugger.showIt(activityName + ": image resize method " + image.getBounds() + " --> " + theWidth + " x " + theHeight);
  7. Bitmap d = ((BitmapDrawable)image).getBitmap();
  8. Bitmap bitmapOrig = Bitmap.createScaledBitmap(d, theWidth, theHeight, false);
  9. return new BitmapDrawable(bitmapOrig);
  10. }

Report this snippet  

You need to login to post a comment.