loading photos

derez

Expert
Licensed User
Longtime User
My MIO 350 does not want to load photos with size of 1 MB using basic4ppc programs, it complains about memory, but it agrees to do it when using other programs, for example RPHOTO.

Why ?
 

agraham

Expert
Licensed User
Longtime User
Not enough information to comment I'm afraid. What is the actual error message? Does it happen on the first photo. Are you trying to load more than one at conce? What are you loading them into, Bitmaps, Images ... ?

You need to explain the sequence and objects involved. There is a memory leak problem with ImageLib and ImageLibEx Bitmaps in Basic4ppc version 6.50 and earlier that is fixed in version 6.75 and later. Actually this affects all library objects but is most damaging with Bitmaps because of their size.
 

derez

Expert
Licensed User
Longtime User
The problem is when I load a single photo to an imagelist with "add" or I want to draw it on a form with drawimage.
The error is:
"OutofMemoryException"
I'm using 6.76 (it appeared in the previous versions as well).
 

derez

Expert
Licensed User
Longtime User
Here it is :)
It is the first photo loaded, except for small buttons images.
Help for the operation:
The first button starts loading of one picture, the second is for the whole directory (then you can use the green arrows).
 
Last edited:

derez

Expert
Licensed User
Longtime User
I tried to replace the imagelist which I load the photo to, with a imagelib bitmap object, using new1.
The result is the same.
 

agraham

Expert
Licensed User
Longtime User
It fails on my iPAQ 214 as well with big photos. I assume that "size of 1MB" refers to the size of the jpg file. Assuming something like an 8Mpixel camera as the source for a file of this size this expands to something like 24MBytes. Your Mio has 64MBytes of memory so it looks like the picture size is just too big as ImageList loads the images into full size Bitmaps.

I've tried to find the RPHOTO program you mentioned but I can only find desktop versions. :confused: However specialist photo programs for devices (and desktop apps like PhotoShop and PaintShop Pro) will use programming techniques that minimise the amount of memory being used, like only loading the part of the photo being displayed and they will be written in native code so they can control the use of memory directly, they won't just load the entire picture into a Windows Bitmap at full resolution. I am afraid that manipulating large photos will not be possible in Basic4ppc.
 

derez

Expert
Licensed User
Longtime User
More on loading photos

Agraham
Processing what you wrote, the problem is not in the total memory but is a limitation on the size (or number of pixels) in one image.
In my navigation program I use a imagelist with 9 maps in memory all the time, each the size of 1000 by 1000 pixels, and it works.
If there is a way to split the image file to few pieces (horizontally or vertically, or both to create tiles) - I could have handled the reunion on the form...
My knowledge on jpg files is too short to be able to do it.
I'll appreciate if someone (!) will do it, I believe it may be of use to many members of this great forum.
Thanks again.
 
Top