PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Problem loading a larger image

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
Be sure to use non-progressive jpeg's.
This is probably limitiation of imgdecmp.dll, which is used to decode images. This will be fixed/replaced in the next release.
BIGBEN wrote:Be sure to use non-progressive jpeg's.


I am using non-progressive jpegs.

Thierry wrote:This is probably limitiation of imgdecmp.dll, which is used to decode images. This will be fixed/replaced in the next release.


I hope you're right Thierry. Looking forward to the next release.

Thanks for your answers.
/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
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
Slim wrote:If I load a large picture the app hangs at:

HRESULT hr = ::DecompressImageIndirect( &dii; );


That's the problem I was mentionning previously with large images.

Slim wrote:If I just create a large surface by calling

display->CreateSurface(width, height);

the app hangs at:

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


How large is your surface? Maybe you are running out of memory after all... There is no limits to width and height, but make sure you have enough memory and that your values aren't negative.

The memory needed to construct the surface is "width * height * 2 bytes".