How to do transparent color in the CBitmapButton? [modified]
-
Hi all, I have created the button in my project like this:
CBitmapButton m_mainSettings; DDX_Control(pDX, IDC_MAIN_SETTINGS, m_mainSettings); m_mainSettings.LoadBitmaps(IDB_BITMAP1); m_mainSettings.SizeToContent();
All works good, except greyed frame arround bitmap. So I need to add a transparent color for the bitmap. Please help me to resolve the problem. -- modified at 14:38 Sunday 17th June, 2007 -
Hi all, I have created the button in my project like this:
CBitmapButton m_mainSettings; DDX_Control(pDX, IDC_MAIN_SETTINGS, m_mainSettings); m_mainSettings.LoadBitmaps(IDB_BITMAP1); m_mainSettings.SizeToContent();
All works good, except greyed frame arround bitmap. So I need to add a transparent color for the bitmap. Please help me to resolve the problem. -- modified at 14:38 Sunday 17th June, 2007AFAIK, CBitmapButton doesn't support transparent colors. You could derive a class from CBitmapButton, override the DrawItem() method, and draw the bitmaps yourself using transparency, perhaps with GDI+ or masked bitmaps. CBitmapButton uses BitBlt() to draw the bitmaps. An easier (IMO) approach would be to use a toolbar control. There you can use image list(s) which will handle transparency and true-color bitmaps easily. Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder