I've searched numerous topics and have not found one useful example (code language does not matter) on how to avoid a black background when loading a picture which supports transparence. It happens with GIFs, PNGs and ICOs at least.
Can anybody give an example on how to set/define a background color to be used when loading the picture? Can be Delphi, C++, VB... anything. Thanks.
xnview wrote:You have the transparency index in GFL_BITMAP
Yes, you answered the same in a couple of threads. But not more. It seems obvious to you what to do with it, but not to me.
What should I do with it? I suspect it's an index on the color palette - should I directly modify this color on the palette into RGBA white? It's a SmallInt - that makes its highest value 32767 - pretty low for all colors used on a palette, or am I missing something here?
Also: when loading my transparent ICOs, CURs or GIFs GFL_BITMAP.TransparentIndex is always -1.
AmigoJack wrote:
What should I do with it? I suspect it's an index on the color palette - should I directly modify this color on the palette into RGBA white? It's a SmallInt - that makes its highest value 32767 - pretty low for all colors used on a palette, or am I missing something here?
Yes it's the index of colormap
Also: when loading my transparent ICOs, CURs or GIFs GFL_BITMAP.TransparentIndex is always -1.
For .ico/cur GFL doesn't support mask so TransparentIndex is always -1
For the GIF, the problem is 1bit, if you convert it in 4bits for example, there is no problem...