Re: DrawIconEx weirdness under Win2K



> I use DrawIconEx to draw an icon onto a metafile DC.
> Everything works ok under WinXP but under Win2K I get a black square.
>
> What am I doing wrong?
>
> Code below is a simplified version of what I'm using (needs to be pasted in
> Form1 of a standard project and needs an icon in Form_Load).

If your icon has an alpha channel then DrawIconEx() under Win2K won't interpret it correctly and simply draws the 24-bit data
instead, this could be the cause of your problem. If this is the case then simply select the colour Bitmap returned to you in the
GetIconInfo() call into a temporary DC and AlphaBlend() it instead.
Hope this helps,

Mike


- Microsoft Visual Basic MVP -
E-Mail: EDais@xxxxxxxx
WWW: Http://EDais.mvps.org/


.



Relevant Pages