It doesn't appear as if Windows API has native support for loading .jpg or gif images. So what is the best way to load .jpg or gif images -- from a file, not a resource -- using API?
Could someone point me in the right direction?
thank you
Echidna
This is a discussion on Loading .jpg images from a file within the Windows Programming forums, part of the Platform Specific Boards category; It doesn't appear as if Windows API has native support for loading .jpg or gif images. So what is the ...
It doesn't appear as if Windows API has native support for loading .jpg or gif images. So what is the best way to load .jpg or gif images -- from a file, not a resource -- using API?
Could someone point me in the right direction?
thank you
Echidna
I would try to see if there is an ActiveX to display a jpg
OleLoadPicture can handle most image formats including jpeg & gif.
Gdiplus also has support for handling all sorts of image formats which comes as part of winxp. You can download the dll etc from ms if you don't have/use xp - do a search on this forum as i've posted a link to it a few times.
Thanks for the help.
I found an example here:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q218972
http://support.microsoft.com/default...US/Loadpic.exe
The problem with it is that it doesn't realize the palette on systems that only display 265 colors -- I just happened to compile the code on my old laptop.
The image displayed using the LoadPic.exe only shows 16 colors. Is there a way to get the OleLoadPicture() function to realize the palette???
Has anyone else encountered this problem?
(I will look into the "Active X" suggestion)
Didn't know about that LoadPic example - it's a good one. Thanks.
I found the gdiplus links:
Go here to get GDI+ run-time dll - (it's called 'GDI+RTM'):
http://www.microsoft.com/msdownload/...psdkredist.htm
I didn't notice any problem with displaying images with more than 16 colours - nor was I aware of the 256 colour display problem either. Both interesting - but unfortunately I don't have a clue at the moment. I will take a look at it....sometime.
Good luck anyway.