Hello, I have a bunch of pixel data in an int[] that I want to turn into a Bitmap instance. The problem is, the pixel data is so big it barely fits into memory. I thought it would be no problem, surely I can pass the int[] to a Bitmap factory method which simply wraps it in a Bitmap instance. Unfortunately, this does not seem to be the case - createBitmap(int[] colors, int width, int height, Bitmap.Config config) seems to allocate its own int[] and copy the passed in int[] into it, which fails if there is no memory for another copy.
I simply need to turn the image stored in the int[] to a .png on external storage so actually any of the following would be good enough for me: - as mentioned above, a way to create a Bitmap so that it doesn't try to allocate another useless copy of the data - an accessor on Bitmap to return the Bitmap's pixel store as an int[] (that way I wouldn't have to allocate my own int[] and would be able to write directly into the Bitmap-owned memory) - a way of accessing (an equivalent of) Bitmap.compress() functionality without having a Bitmap Amazingly, none of the above seems to be available! Bitmaps tend to be large objects in memory, surely there must be ways to handle them in a memory-efficient manner... Cheers! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en