There are at least two methods to scale a bitmap in Android, One is to use "inScaled, inDensity, inTargetDensity" in "BitmapFactory.Options" when decode a bitmap source. The other is to use a "Matrix" in "Bitmap.createBitmap".
What I am curious is what the difference between these two method is? What about the quality of produced bitmap? And what about the memory usage? etc...
Using BitmapFactory
with the proper inScale options will allow you to be more memory efficient than using either Bitmap.createScaledBitmap()
or Bitmap.createBitmap()
with a matrix scale. However, it is more complicated.
Check out How do I scale a streaming bitmap in-place without reading the whole image first? for details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With