J2ME Memory Limitations for Images
Hi ...
I have a J2ME app which loads up an image, the user is then able to scroll around the image and edit it. However I have had big problems with larger images ( greater than 800 x 800 px ). This is down to memory limitations going by the error message on certain devices.
I am currently loading the image by putting it in a tiledLayer which works well for scrolling it neatly. So far the only thing I can think to get round the limitation is to slice the image in to smaller parts and load up a new tiledLayer when comming to the edge of the previous one.
Would this work or will the memory limit still be breached when spread over numerous tiledlayers ?
Perhaps there is a better way of doing this that I havent thought of ?
Many thanks for any suggestions ...
Chris
# 2
It depends how you will load your image. If you just load it via Image.createImage(), it wouldn't change anything if you would split the picture onto several TiledLayers, because the image would be loaded as a whole into the memory and would take up more than 0,6 MB of space in memory. (Assuming a 800x800 picture. Depending on the device it can be even more than a Megabyte).
Is your image located within the jar-file or do you load from a webserver?
# 5
Hi,
They are large satalite map images. Each image comes as a 800x800px PNG file.
The problem I have is that even if I cut the image in to sections, say 320x270 ( the screen size, I think? ) I may still need to have 4 of these in memory at once if the screen is scroled like the picture below ( so I would be loading in just as much data as before ).
|
-
|||
|1 | 2|
|||
|||
|--|-
|||
|3|4|
|||
|||
-
|
Or do you mean I remake the Tiled layer on each move so that only the 320x270 pixels are in memory? I think I might have to ditch the TiledLayer if I do it like this ...
Message was edited by:
chris_j_pook
Message was edited by:
chris_j_pook
Message was edited by:
chris_j_pook