Converting an icon into a bitmap
-
Hello, I need to convert icons to bitmaps. I have written something that works OK on 2000 and other systems but that fail on XP: the transparent color is replaced by black instead of being well transparent. Maybe it is related to getting a "too many color" icon were the 256 colors version is enough for what I am doing... Does anyone has something to suggest? Regards
-
Hello, I need to convert icons to bitmaps. I have written something that works OK on 2000 and other systems but that fail on XP: the transparent color is replaced by black instead of being well transparent. Maybe it is related to getting a "too many color" icon were the 256 colors version is enough for what I am doing... Does anyone has something to suggest? Regards
-
Hello, I need to convert icons to bitmaps. I have written something that works OK on 2000 and other systems but that fail on XP: the transparent color is replaced by black instead of being well transparent. Maybe it is related to getting a "too many color" icon were the 256 colors version is enough for what I am doing... Does anyone has something to suggest? Regards
If you haven't already, you need to look at GetIconInfo. This function fills in a structure with two bitmap. One is the colour info, and one is the transparency map. The transparent part *should* be black on the colur bitmap, but you can separate it using the 2nd bitmap for reference. Iain.
-
If you haven't already, you need to look at GetIconInfo. This function fills in a structure with two bitmap. One is the colour info, and one is the transparency map. The transparent part *should* be black on the colur bitmap, but you can separate it using the 2nd bitmap for reference. Iain.
Iain, I saw this one and definitly wanted to take a look at it... Thanks for the infor. Regards
-
Can you send me the code? I worked on somthing that does this exact thing some time ago and i might be able to help you....
Does your stuff work? My code is just around 10 lines of code where I build a DC, select an empty bitmap into, draw the icon with DrawIconEx in DI_NORMAL mode and that's it. Do you do something similar?
-
If you haven't already, you need to look at GetIconInfo. This function fills in a structure with two bitmap. One is the colour info, and one is the transparency map. The transparent part *should* be black on the colur bitmap, but you can separate it using the 2nd bitmap for reference. Iain.
Okay tested it but it appears that the bitmaps returned are wrong. Basically I get my icon from the system image list in where the icons are 32 bit with alpha. When I get them I get a 256 color version but the conversion is wrong: some parts of the mask that are gray become black where as in the icon the matching pixel gets black also. So I get black. What I need now is to force the extraction in 256 colors. The problem is that I get a handle to an icon in the system image list and I do not know where this icon is located on disk so I can't really extract it from the .ico file. Anyone?