0

I am working on a very simple app that shows one jpg, which is scrollable on vertical axis. I would like this image to be very large(20000x1000 px), however, when I try to run the app on my device, it says that "bitmap too large to be uploaded into a texture". Is there a way to display the image of such size in an android app? If not, would it be possible to divide the image into segments, and after I scrolled to the bottom of one segment, I would proceed to another?

g00glen00b
  • 41,995
  • 13
  • 95
  • 133
Jay Smith
  • 1
  • 1

2 Answers2

1

To quote the answer for your question here:

All rendering is based on OpenGL, so no you can't go over this limit. Note that this would take a huge amount of memory. With such big images, if you want to zoom in out, and in a mobile environement with heavy memory constraints, you should setup a system similar to what you see in google maps for example. With the image split in several pieces, and several definitions.

Community
  • 1
  • 1
AggieDev
  • 5,015
  • 9
  • 26
  • 48
0

You could split the images into let's say 128x128 chunks. Add them to an array, and loop the array to create and fill an ImageView with the image that is currently served.

some pseudocode would be: (excuse me, I've been programming a PHP application the past few days)

Private BitMap[] imageArray = {your bitmaps from internal or external storage};
For(BitMap bm in imageArray) {
    // create a new image view here, use the correct layout params or use a parrent grid view.
    imageView.setBitMap(bm)
}

now once again, I am 0% sure about that pseudo code, but it should help you along.

cytodev
  • 87
  • 1
  • 6