Problems with IIMAGE | developer.brewmp.com Problems with IIMAGE | developer.brewmp.com

Developer

Problems with IIMAGE

Forums:

I'm trying to display an image which is larger because it should contain multiple frames for a small animation. The problem is that if I'm loading an image which is wider than around 275 pixels, the image won't be displayed at all. The height is of 144 pixels and the format is PNG (because size is critical for the app).

Can you help me in any way ? I'm doing something wrong ?

pApp->pAnim=ISHELL_LoadImage(pApp->a.m_pIShell, "untitled1.png");
if (pApp->pAnim)
{
IIMAGE_Draw(pApp->pAnim, 0,0);
}

With an image of w/h of 273/144, the drawing of the image succeeds. If the image has w/h of 290/144, the screen goes black !! With the w/h of 300/144, the screen goes white !! Is this normal ?

The image you're trying to load will take up 80k in memory, and might even be more duing the loading process so you might be running out of memory.
Check the dimensions of the image after loading, if you're out of memory the load won't return an error, but the image dims will be 0.
Tom

The image you're trying to load will take up 80k in memory, and might even be more duing the loading process so you might be running out of memory.
Check the dimensions of the image after loading, if you're out of memory the load won't return an error, but the image dims will be 0.
Tom

The pointer to the image is valid. Also, the memory seems to be ok, as before loading the image the memory had only 90k occupied and after had 175k occupied.
The image is the only thing I have to display on the screen, so the memory shouldn't be a problem.
How can I load only a chunk of an image (for saving memory) ?

The pointer to the image is valid. Also, the memory seems to be ok, as before loading the image the memory had only 90k occupied and after had 175k occupied.
The image is the only thing I have to display on the screen, so the memory shouldn't be a problem.
How can I load only a chunk of an image (for saving memory) ?

Even if your format is PNG the image still at some point is going to be decompressed into a native bitmap format. A decompressed 24bit image of size 144x275 is going to take up around 118k of memory. It sounds like memory is not your problem.
The problem you are encountering may be a limitation with the PNG decoder.
For animated images BCI works very well.

Even if your format is PNG the image still at some point is going to be decompressed into a native bitmap format. A decompressed 24bit image of size 144x275 is going to take up around 118k of memory. It sounds like memory is not your problem.
The problem you are encountering may be a limitation with the PNG decoder.
For animated images BCI works very well.

Kindly upload the images, so that we can check the problem. I don't have problem with opening a large dummy images (only red color filled).

Kindly upload the images, so that we can check the problem. I don't have problem with opening a large dummy images (only red color filled).

Which handset are you developing for? some handsets have problems with PNG images (memory leaks)
Also, if you image has multiple frames, you probably should use IIMAGE_SetFrameSize() and IIMAGE_SetFrameCount() or IIMAGE_SetParm().
-Tyndal

Which handset are you developing for? some handsets have problems with PNG images (memory leaks)
Also, if you image has multiple frames, you probably should use IIMAGE_SetFrameSize() and IIMAGE_SetFrameCount() or IIMAGE_SetParm().
-Tyndal