1

In my app I'm loading an image of 1940*1740 that I want to display (it's scrollable). The problem is that I always get an exception

Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

I know that there is a limit of 24M per application, so what can I do ? Cut my image in several parts and load them only when the user scrolled at the border ?

Stephane Mathis
  • 6,542
  • 6
  • 43
  • 69
  • 1
    [How to load tiles from a large bitmap in Android](http://stackoverflow.com/questions/4753013/how-to-load-tiles-from-a-large-bitmap-in-android/5089350#5089350) – tiguchi Jun 30 '12 at 15:16
  • Thanks, too bad it was intoduced in the API level 10. – Stephane Mathis Jun 30 '12 at 15:58
  • possible duplicate of [Is it possible to chop a bitmap to small pieces without loading the entire thing into memory?](http://stackoverflow.com/questions/4815192/is-it-possible-to-chop-a-bitmap-to-small-pieces-without-loading-the-entire-thing) – Ron Jul 01 '12 at 06:34
  • Thanks userSeven7s but your link is also in the answer refereced by the link of Nobu Games. – Stephane Mathis Jul 02 '12 at 13:11

1 Answers1

0

I've come to the conclusion that it is not possible with the API lvel 7. Since Android 2.3.3 we can use the class BitmapRegionDecoder.

Stephane Mathis
  • 6,542
  • 6
  • 43
  • 69