Resizing a bitmap

后端 未结 3 684
终归单人心
终归单人心 2021-01-01 00:49

The code below resizes a bitmap and keeps the aspect ratio. I was wondering if there is a more efficient way of resizing, because i got the idea that i\'m writing code that

相关标签:
3条回答
  • Depends on how you're using the image. If all you want to do is display the bitmap in a View, just call myImageView.setImageBitmap(bitmap) and let the framework resize it. But if you're concerned about memory, scaling first may be a good approach.

    0 讨论(0)
  • 2021-01-01 01:42

    I really don't think so, I have done almost the same way as you, and got the idea from the android developer pages...

    0 讨论(0)
  • 2021-01-01 01:45

    Use the method Bitmap.createScaledBitmap() :)

    0 讨论(0)
提交回复
热议问题