Loading image in android without bitmap

to go straight to the point I would like to download and show a large image in my android app such a large image -> http://viewhdwall.com/wp-content/uploads/2014/09/Wonderful-Purple-Bridge-Wallpaper .jpg

Loading this large image throws an OutOfMemory exception.

Doing a few calculations, if I load this image into a bitmap using ARGB_8888 it will use as much as 285MB of memory (11658 * 6112 * 4) and there is a lot of memory for the application for that. So my question is, can I load this large image into an image without using a bitmap? In a way that doesn't use that much memory.

To make an example, I opened this large image in Windows PaintBrush and used as much as 700MB of memory, when I opened the large image in Windows Photo Viewer, it used a maximum of 30MB (I'm using Windows 8).

Explanation: Just to clarify, shrinking the image using the "inSampleSize" parameter from BitmapFactory.Options is not an option for me, because if I reduce the size of the image it will no longer be a "large image".

Edit 1

I want the user to be able to enlarge the image if they want, so I cannot lose quality (this will have to do with the reduced dimensions of the image). I know that the device screen itself will do a thumbnail image, but if I use a bitmap I have information about all the details of the image, but that just uses up a lot of memory. Windows Photo Viewer achieves this without consuming a lot of memory.

+3


source to share





All Articles