ImageList_Draw and icons with alpha channel

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi,

I'm creating a memory DC which is compatible to the desktop's DC. I set
the background color to GetSysColor(COLOR_HIGHLIGHT) and the text color
to GetSysColor(COLOR_HIGHLIGHTTEXT). Then I create a bitmap, select it
into the memory DC, fill it with COLOR_WINDOW and select a valid font
into the DC.
The next thing I do is draw an icon into that DC using ImageList_Draw()
with ILD_NORMAL. The imagelist was created with ILC_COLOR32 and ILC_MASK
and contains 32bpp icons (i. e. they have an alpha channel). Afterwards
I fill a rectangle next to the drawn icon with COLOR_HIGHLIGHT and draw
a text into that rectangle using DrawText() with DT_EDITCONTROL,
DT_NOPREFIX, DT_SINGLELINE, DT_VCENTER and DT_END_ELLIPSIS.
Last but not least I create another imagelist with ILC_COLOR32 and
ILC_MASK and add the bitmap I just drew to that imagelist.

Now here's my problem:
I draw the bitmap to a window's DC using ImageList_Draw() with
ILD_NORMAL. On Windows XP, the icon is drawn together with the text -
just as expected. But on Windows 2003 the icon is drawn and the text is
missing. This only happens if the icon has an alpha channel.
Why does this happen and how can I fix it?

Note: DrawText() does NOT fail.

Thanks in advance
Timo
--
www.TimoSoft-Software.de - the home of ExplorerTreeView
Stop software patents!
.



Relevant Pages

  • Re: ImageList_Draw and icons with alpha channel
    ... Timo Kunze wrote: ... > I'm creating a memory DC which is compatible to the desktop's DC. ... > the background color to GetSysColorand the text color ... > The next thing I do is draw an icon into that DC using ImageList_Draw ...
    (microsoft.public.win32.programmer.gdi)
  • ImageList_Draw and icons with alpha channel
    ... I'm creating a memory DC which is compatible to the desktop's DC. ... the background color to GetSysColorand the text color ... The next thing I do is draw an icon into that DC using ImageList_Draw ... I fill a rectangle next to the drawn icon with COLOR_HIGHLIGHT and draw ...
    (microsoft.public.win32.programmer.gdi)
  • Button background color
    ... I have drawn an icon on each of the buttons ... the background color in DrawItem function with these code lines: ... background color by mean of the methods SetBkMode and SetBkColor, ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: [9.2.2] Any Mozilla 1.3.1 tweaks?
    ... This one is applicable - not to Mozilla, but to Netscape, - and if you choose Netscape, it will browse for Netscape, and then you just select Mozilla folder...strange... ... I can't access the memory settings for any ... Desktop icon issue. ...
    (comp.sys.mac.apps)
  • Frustrated: Saving an icon that Ive gotten with ExtractIconEx VB 6
    ... I want an icon from a file to be saved as an ICO file (Icon ... draw it to a picturebox control with the DrawIconEx API ... I now have a pointer to some kind of memory structure that defines ...
    (comp.lang.basic.visual.misc)