0

i was wondering if is it efficient and possible to set 3000X2000px image as canvas background without resizing it and without getting the memory error.

because i want the real size image and pan around it.

using webview is not an option.

Currenty i tried to the set the background by using a folder structure named "Drawable-nodpi" and then assinging the bitmap image with decoderesource method.

  • You should look at previously asked questions like [this](http://stackoverflow.com/questions/4678331/how-to-tile-and-scroll-a-large-image-10000x10000-in-android). And you might want to do some research about tiling. :) – wojciii Jul 19 '12 at 08:19

1 Answers1

1

Such a huge picture will inevitably cause outofmem exceptions on at least some devices. So I think that you need to dynamically scale and load only parts of the image that needs to be displayed, possibly with a caching mechanism.

Unfortunately, I don't know about any library components for Android that does this for you out of the box, but I'm pretty sure that you can find some nice articles on this topic.

Zsombor Erdődy-Nagy
  • 16,864
  • 16
  • 76
  • 101