Hello people, I'm new to Gapidraw and I am bulding a map browser for Pocket Pc. So far every thing works fine except I can't load an image (a street map ) any larger than 1.3megs. The image is on the ipac ok but when Gapi tries to load it, it seems to just ignore it and carry on.
There is most likley some simple solution thats been covered numerous times already, so if this is the case I apologise and would appreciate being pointed towards the appropriate posts, thanks.
Hi,
Use PNG or BMP if you want to use large images. GapiDraw loads these formats with virtually no overhead, so the only memory required in bytes is WIDTH*(HEIGHT+1)*2 to load any PNG image. If you use JPG or any other format much more memory is required due to Windows CE limitations.
That was quick Johan,
actually I am using pngs already and the problem persists.
You should check your available RAM memory in the device. If it should be enough, try resetting the device to defragment the heap.
Unfortunately I have tried resetting the PDA and this made no difference. I take it there should be no problem creating a surface to take a large png, say 2 to 3 megs as long as the machine has sufficent memory, in this case with very little else installed there appears to be ample.
Did you check the return codes for CreateSurface? What error code does it give?
Are you talking about 2-3 Mb when created in GapiDraw or 2-3 Mb Png image? What is the dimensions of your image? remember that Png is a compressed format and GapiDraw surfaces are uncompressed. Look at Johans formula above and calculate how much memory your image will require.
Ouch!!
Yes, my 3.34MB image based on Johan's formula blows out to some 50MB!! and yes "egarayblas", as you would, expect the error code returned was "Out of Memory" . This obviously creates a problem for a map browser as for this app to be truly useful it we will need to load reasonable sized maps with enough detail to make them legible, particularly when zoomed out. Somebody must have come across this before, is there a solution short of going out and buying the biggest, meanest PDA around (not an option for most of us).
I'm guessing that too.

Anyway, maybe its possible if you can cut the large image into small ones and load/assemble them as they are needed?
As suggested - use several maps with different zoom levels that you all split into multiple segments and load the segments dynamically into memory. That way you can have a nice map-zoom function as well...