Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help masking images in CImageList

Status
Not open for further replies.

qedusa

Programmer
Joined
Jan 12, 2002
Messages
43
Location
US
Hi, I'm just about ready to tear my hair out with this. I'm trying to draw a "masked" bitmap using CImageList. I've tried just about every combination and everything I can think of. Also, the text books not very clear nor is Microsfts help. Here's the latest piece of code - if someone could tell me where I'm going wrong...

short width = 600;
short height = 94;
POINT pt;
CBitmap bmp;
CBitmap mask;

pt.x = hCtr-(width/2);
pt.y = vCtr-(height/2);

CImageList bList;
bList.Create(width,height,ILC_COLOR | ILC_MASK,2,0);
bmp.LoadBitmap(IDB_CTRLOGO);
bmp.LoadBitmap(IDB_CTRMASK);
bList.Add(&bmp,&mask);
bmp.DeleteObject();
mask.DeleteObject();
bList.Draw(pDC,0,pt,ILD_NORMAL);

I've tried changing background colors, not adding the mask, using ILD_TRANSPARENT etc etc - nothing seems to work. I'm sure it's something really simple I'm missing but my head is clouded at the moment with thoughts of "murder!".

Can anyone help please!?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top