How do you change the size of Bitmap?



  • I'm doing a picture and I'm keeping it in 'ArrayList Bitmap', and before I keep the pictures on the map, I'm taking them out to 'GridView'. But because the picture of "Bitmap's big," in 'GridView, they don't look right. I tried before I kept doing that.

    bitmap.setHeight();
    bitmap.setWidth();
    

    But the studio emphasizes and says I can't use these methods. If I understood correctly, it had to do with API.

    Tell me how to make a picture of 50 pickles?



  • I understand you're looking for a way to scale Bitmap's to the right size. In such a case, a method of scale up to the required sizes should be used:

    Bitmap.createScaledBitmap(originalBitmal, newWidth, newHeight, isFilter)
    

    Details can be read http://developer.android.com/intl/ru/reference/android/graphics/Bitmap.html#createScaledBitmap(android.graphics.Bitmap,%20int,%20int,%20boolean) as usual.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2