Page 1 of 1

workaround: don't call IMGDECMP.DLL

PostPosted: Apr 5, 2009 @ 1:10pm
by CodeFlatter

PostPosted: Apr 5, 2009 @ 8:37pm
by PsychoChris
Hi CodeFlatter,

i would suggest to completely avoid using SHLoadImageFile() for Windows Mobile 5.x and higher since it has some known issues regarding large images that lead to unpredictable failures while loading some images. Also avoid imgdecmp since it is deprecated. Better use the .
It also supports loading thumbs, sizing operations, different decoders and also runs under pure WinCE. Only drawback: A little bit more code and usage of COM. But it is worth the effort.

Regards,
Chris[/url]

PostPosted: Apr 6, 2009 @ 2:43pm
by Presto
All of my games use the SHLoadImageFile, and I haven't run into any problems. In fact, I don't think I even started using that until WM5 because the original code became deprecated.

PsychoChris, do you know how large the image needs to be to start having problems? I know 240x1400ish work just fine.

-John

Thx 4 info

PostPosted: Apr 6, 2009 @ 8:44pm
by CodeFlatter
Thanks at PsychoChris and Presto! :)

I will see if I find code examples to use imaging api, com code is more complex...

Best regards
CF :roll:

PostPosted: Apr 6, 2009 @ 10:58pm
by PsychoChris
@ Presto:
We encountered not clearly reproducable problems using SHLoadImageFile() with images of dimensions 1600x1200 or larger. Especially images created by cameras of mobile devices. Those images loaded most times fine in the emulator but return NULL handles on devices although memory on the device was more than sufficiant. You can find similar issues by googling around. Solutions suggested by microsoft developers always pointed out avoiding that function and using Imaging API (see for instance).
Using the Imaging API we didn't encounter those problems anymore.


@ CodeFlatter:
Take a look at . It shows you how to implement loading images with Imaging API for WM 5.x and higher and also includes a fallback solution for older devices not providing that API.


Regards,
Chris

THX

PostPosted: Apr 7, 2009 @ 9:24am
by CodeFlatter
Hello PsychoChris,

thx 4 the link, this page is helpfull - but use MFC code (no one of my mobile app's use MFC).
I need an example without MFC (using of MFC is impossible for me) or an simple code snipped...

Regards, CF

PostPosted: Apr 7, 2009 @ 12:57pm
by PsychoChris

Nice!

PostPosted: Apr 7, 2009 @ 1:08pm
by CodeFlatter

PostPosted: Apr 8, 2009 @ 2:27pm
by Presto

PostPosted: Apr 9, 2009 @ 9:14am
by CodeFlatter
Thx Presto and dito. :-)