Click to See Complete Forum and Search --> : CreateIconIndirect and mask


Chirieac
June 28th, 2008, 07:52 PM
Hello! I've tried to create an icon from two gdi+ bitmaps and I can't make the icon transparent.
Here's my code:
ICONINFO iconInfo = {0};
iconInfo.fIcon = TRUE;
bmp.GetHBITMAP(Color(255,0,0), &iconInfo.hbmColor);
bmp2.GetHBITMAP(Color(255,0,0), &iconInfo.hbmMask);

HICON hIcon = CreateIconIndirect(&iconInfo);
It seems that hbmMask is not set. Why?

Bye!

Chirieac
June 29th, 2008, 02:03 AM
If I load the icon HBITMAPS from resource it's working.
iconInfo.hbmColor = LoadBitmap(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDB_BITMAP2));
iconInfo.hbmMask = LoadBitmap(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDB_BITMAP1));
The problem might be on Bitmap::GetHBITMAP()?