On 04/14/2010 06:16 AM, Tim wrote:
On Apr 14, 1:47 pm, Kamal Hasan<[email protected]>  wrote:
Hi,
     When I am trying to load even a image of 4 MB the application is
giving OOM error.Is there any alternative way to create bitmap from
large images? What is the maximum heap for an application?

                         FileInputStream fin = new FileInputStream(new
File("sdcard/DSC00712.jpg"));
If the JPEG is 4 MB then the decoded image will be huge. What are the
dimensions of the image?


What I've had to do in these situations is use BitmapFactory.Options ()
inSampleSize to scale the image down while it's reading the file.
AFAIK, there's no way to work on the full image directly. Sort of a
surprising result since the phone can take those pictures but can't
manipulate them directly, but they are enormous.

Mike

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to