如何在VC2008中将bmp加载到CRebar中作为背景? [英] How can I load a bmp in the CRebar as a background with VC2008?

查看:83
本文介绍了如何在VC2008中将bmp加载到CRebar中作为背景?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的先生:
当我尝试使用VC2008在CRebar中将bmp图片作为背景加载时遇到一个大问题,但bmp图片无法显示,而我可以使用VC6 ++轻松实现.我将代码粘贴到这里,希望能有所帮助.
您真诚的
呵呵.

Dear sir:
I meet a big problem when I try to load a bmp picture as background in CRebar with VC2008 but the bmp picture cannot be displayed,while I could implement it easily with VC6++. I paste the code here, and hope I could get a hand.
Yours sincerely
whhans.

CRebar m_wndReBar;
m_wndReBar.Create(this); 
m_wndReBar.AddBar(m_wndToolBar);
REBARBANDINFO rbbi;
rbbi.cbSize = sizeof(rbbi); 
rbbi.fMask = RBBIM_CHILDSIZE | RBBIM_IDEALSIZE | RBBIM_SIZE|RBBIM_BACKGROUND;
rbbi.cxMinChild = rectToolBar.Width();
rbbi.cyMinChild = rectToolBar.Height();
rbbi.hbmBack = LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_TOOLBARBKMAP));
rbbi.cx = rbbi.cxIdeal = rectToolBar.Width() * 10;
m_wndReBar.GetReBarCtrl().SetBandInfo(0, rbbi);

推荐答案

设置fStyle,可能是bmp的位宽错误
you havent set the fStyle, maybe the bmp has the wrong bit-width


这篇关于如何在VC2008中将bmp加载到CRebar中作为背景?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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