-1

Possible Duplicate:
How to resize a BitMap in android?

Can anyone show me how to scale a Bitmap object in Android. I want to change the height and width of the bitmap object to fit an ImageView.

Kind Regards

Community
  • 1
  • 1
user1730789
  • 5,157
  • 8
  • 36
  • 57
  • 4
    Hi welcome to Stackoverflow. Please do at least a little research and show effort before asking a question. If you read the documentation for ImageView, you will find this in less time than it took me to write this comment. http://developer.android.com/reference/android/widget/ImageView.html#setScaleType(android.widget.ImageView.ScaleType) – Simon Oct 10 '12 at 05:57

2 Answers2

2

Here is how you can scale your bitmap to required size:

   Bitmap bitmap = Bitmap.createScaledBitmap(realBitmap,imageWidth, imageHeight, true);

Here you can give imageWidth and imageHeight according to your need. "realBitmap" is the real bitmap you have and "bitmap" is the Bitmap returned after scaling.

Yogesh Somani
  • 2,624
  • 3
  • 21
  • 34
0

here it is . please do some homework on your own

Ashwani
  • 1,574
  • 14
  • 28