I am using the following code to get a bitmap from the image file in Android:
Bitmapfactor Option option = new bitmapfactor Option (); Options.inPreferredConfig = Bitmap.source. ARGB_8888; Bitmap bitmap = bitmapfender Decodefile (path, option);
However, the size of the bitmap is more than twice the size of the file. For example, for a 520kb file size, the bitmap size is approximately 1.3MB. Is there any way i can get a bitmap of the same size as the file?
Bitmap size is pure memory data without compression. You can size 4 bytes per pixel (in your settings Together) can calculate.
Your file is probably in a compressed format such that without jpg compression it will take only one place.
The bitmap is kept unmodified in memory because the reason is basically the display. You can read the data and work very fast with it in the uncompressed way. For example, if you want to see what is the color of a specific pixel, then you will need to move the data first without taking it time it takes time and there is more pixels that the more time you take it checks.
When reading a file from storage, uncompression takes only a rare amount of time compared to the complete reading process. You will not have a bigger display effect than "on demand" uncompression
Comments
Post a Comment