Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Transparent images in CExtToolControlBar Collapse All
Subject Author Date
Richard Gardner Feb 7, 2008 - 11:50 PM

Hi
I have such an image http://designleon.com/temp/Open.bmp which has a color which shall be transparent.
I’m trying to use it for a button in ToolControlBar, but I can’t make it appear without that transparent color.
I tried this way
CExtBitmap bmp;
g_ResourceManager->LoadBitmap(bmp, IDB_BITMAP_OPEN);
bmp.Make32();
//bmp.AdjustHLS(RGB(255, 0, 255), RGB(3, 3, 3));
g_CmdManager->CmdSetIcon(pApp->m_pszProfileName, ID_DMW_OPEN, bmp);
but anyway I see that redish color
What do I do wrong?
What would be the best way to assign images with transparency to toolbar buttons?

Thx

P.S. Using VS 2005 and Prof UIS 282

Technical Support Feb 11, 2008 - 6:09 AM

You should use the CExtBitmap::AlphaColor() method, which allows you to convert pixels of the specified color to transparent:

CExtBitmap bmp;
g_ResourceManager->LoadBitmap(bmp, IDB_BITMAP_OPEN);
bmp.Make32();

// mark magenta color pixels as transparent
COLORREF clrTransparent  = RGB(255,0,255); // magenta
bmp.AlphaColor( clrTransparent, RGB(0,0,0), BYTE(0) );