Page 1 of 1

Problem loading a larger image

PostPosted: Oct 19, 2004 @ 9:47am
by Slim
Has anybody had any trouble to load a large image with LoadImage(_T(pic.jpg)) of about 300-400 KB and then blit it to screen?

I have tried on different images of different sizes and the limit seems to be around the size mentioned above. The larger images won't load at all and I know that I have enough memory on my device.

Any solution to my problem?

/Slim

PostPosted: Oct 19, 2004 @ 10:44am
by BIGBEN
Be sure to use non-progressive jpeg's.

PostPosted: Oct 19, 2004 @ 2:23pm
by Kzinti

PostPosted: Oct 19, 2004 @ 2:40pm
by Slim

PostPosted: Oct 21, 2004 @ 1:35pm
by Slim
Thierry, I'm not sure if it's the imgdecmp that causes the problem. I tried to debug and the app hangs every time

Surface* surface = new Surface( bitmap.bmWidth, bitmap.bmHeight );

is called. If the width and height are big then the app will hang. Is there a limit to

PHAL::Surface::Create( width, height )?

/Slim

PostPosted: Oct 21, 2004 @ 2:14pm
by Slim
On a second thought, it could be both the imgdecmp.lib and the PHAL::CreateSurface that cause the problems.

If I load a large picture the app hangs at:

HRESULT hr = ::DecompressImageIndirect( &dii );

If I just create a large surface by calling

display->CreateSurface(width, height);

the app hangs at:

PHAL::Surface::Create( width, height )

hmm...
/Slim

PostPosted: Oct 21, 2004 @ 4:41pm
by Kzinti