ImageList_Draw and icons with alpha channel
- From: Timo Kunze <TKunze71216@xxxxxx>
- Date: Mon, 24 Oct 2005 00:58:55 +0200
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!
.
- Prev by Date: GetOpenFileName() to select a folder?
- Next by Date: Building a custom blocking dialog
- Previous by thread: GetOpenFileName() to select a folder?
- Next by thread: Building a custom blocking dialog
- Index(es):
Relevant Pages
|