ctoolbar类中的位图图片加载 [英] bitmap picture loading in ctoolbar class

查看:120
本文介绍了ctoolbar类中的位图图片加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

UINT buttons[3] = {ID_ADD,ID_NEWS,ID_OTHER_VIEW};
if (!m_wndToolBar.CreateEx(this,TBSTYLE_FLAT,WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadBitmap(IDB_MY_TOOLBAR) ||
!m_wndToolBar.SetButtons(buttons,3))
{
TRACE0("Failed to create myToolBar\r\n");
return -1;
}
m_wndToolBar.SetSizes(CSize(37,36),CSize(30,30));


然后为什么在对话框视图中出现黑屏


then why it comes black screen in dialog view

推荐答案

拆分代码:首先创建按钮,然后创建SetButtons,最后创建位图.而且位图分辨率必须正确.
splitt the code: first create the button and then SetButtons and at the end the bitmap. And the bitmap resolution had to be right.


这篇关于ctoolbar类中的位图图片加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆