I implemented a ImageCache. But I'm curious about what type to store in it will cost less.
Now I use BitmapFactory
to get the images from the internet, so I get a Bitmap
first.
Should I convert to a Drawable
to store in my ImageCache or just store the Bitmap is fine?
Any ideas?
Thanks.
Just store the Bitmap. That's what you're caching and I'm not sure what you'd gain by shoving it into a BitmapDrawable first. It would definitely take more space as a Drawable since it contains the bitmap anyway. You don't really lose anything either way as both are convertible back and forth.
Everything depends on if you want to cache an image with different state like a selector (pressed, focused, etc). The bitmap will not contain this information compare to caching the drawable.
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