我有一个CMFCToolBar
- 派生类,其实例是 -CDockablePane
派生类的成员。
我查看了 VisualStudioDemo 示例以了解它是如何完成的,并且到目前为止:
int CMyPane::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
// Removed all "return -1 on error" code for better readability
CDockablePane::OnCreate(lpCreateStruct);
if(m_toolBar.Create(this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_MY_TOOLBAR) &&
m_toolBar.LoadToolBar(IDR_MY_TOOLBAR, 0, 0, TRUE /* Is locked */))
{
if(theApp.m_bHiColorIcons) // Is true, i.e. following code is executed
{
m_toolBar.CleanUpLockedImages();
m_toolBar.LoadBitmap(IDB_MY_TOOLBAR_24, 0, 0, TRUE /*Locked*/);
}
m_toolBar.SetPaneStyle(m_toolBar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY);
m_toolBar.SetPaneStyle(m_toolBar.GetPaneStyle() & ~(CBRS_GRIPPER | CBRS_SIZE_DYNAMIC | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));
m_toolBar.SetOwner(this);
// All commands will be routed via this control , not via the parent frame:
m_toolBar.SetRouteCommandsViaFrame(FALSE);
}
return 0;
}
加载了高彩色图像(24 位),但可以看到洋红色蒙版 (R255 G0 B255)。我不知道如何告诉工具栏识别面具。
这甚至可能吗?