Jaimi wrote:Just to set it straight, the IImagingFactory code doesn't require any new stuff either -- it's been built into the operating system since 1999.
Not saying that people shouldn't use yours (or that mine is better), but for me, the reason that I choose IImagingFactory over SHLoadImageFile (besides the GIF issue), is because IImagingFactory supported loading images straight from a buffer, and was a drop-in replacement for DecompressImage. Since I wanted to support loading textures from "pak" files, I needed this functionality.
Good point, Jaimi. The SHLoadImage functions don't work with objects in a buffer. Also, not to confuse anyone, the resource images don't have to be GIF files, they just need to be in a resource folder called GIF. (Though maybe JPG, PNG, etc work too. I haven't tried those.)
If you look at the MSDN documentation, some pages state:
MSDN wrote:Converts a .gif file in the resource file to a .bmp file. A resource .gif file should be coded in the resource file as follows: IDG_MYIMAGE_GIF GIF DISCARDABLE "MyImage.gif".
Syntax
HBITMAP SHLoadImageResource (
HINSTANCE hinst,
UINT uIdGif
);
But other pages state that it does .png, .gif, .jpg, etc...
Also, I must admit that it's nice to see the community working to make PF better. I still believe that it's the easiest library to work with, by far.