Wednesday, January 6, 2016

LoadImage: Not all bitmaps accepted

I discovered via the comments on my ContextIcons project that the LoadImage function apparently doesn't treat all BMP files equally. Specifically, the function doesn't seem to like unusual DPI, i.e. not 96 pixels per inch. A certain piece of software the comment author used produced bitmaps that were unacceptable in some way; I had success with the standard MS Paint.

It's also worth noting that some of the flags, like LR_LOADTRANSPARENT, only work for images that have less 8 bits per pixel (256 colors). In the compiled version of my DLL, I had set LR_DEFAULTSIZE, but that might not have been a good idea, since it seems to depend on some system configuration that isn't related to the bitmap's actual size.

No comments:

Post a Comment