This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Weird DrawIcon problem


Weird DrawIcon problem

Postby Dan East » May 1, 2002 @ 7:23pm

I've come across a very aggravating problem. Bear with me while I set this up.

I'm creating a 24 bit DIB (CreateDIBSection), selecting it into a Memory DC (CreateCompatibleDC), filling it with a background color which is my transparent color, then drawing icons to it (DrawIcon / DrawIconEx). Now, what is happening (seemingly randomly) is that when I DrawIcon to the DC, the transparent portions of the icon are modifying my background color values. So if I fill with 0x00ff00ff, then DrawIcon to it, the transparent regions are now 0x00fb04fb. Yes, I verified the bitmap's bits with the debugger and it contained ff 00 ff triplets after the fill as it should, then fb 04 fb after the DrawIcon.
Now for the kicker. If I choose 0x00fb04fb as my transparent fill color, then DrawIcon, the transparent regions have become 0x00ff00ff!

Anybody have any clue what is going on with this? The icons are being extracted from an ImageList. Sometimes the problem occurs with some icons, other runs it will effect a different set of icons.

Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby Dan East » May 3, 2002 @ 5:22am

User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby Kzinti » May 3, 2002 @ 7:48am

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron