VC++ MFC Button 显示图片的问题:
先在.h中定义 :CBitmapButton m_Calling;
然后在:DoDataExchange(CDataExchange* pDX)中
DDX_Control(pDX, IDC_BNT_MAKECALL, m_Calling);关联到Button
然后在
OnInitDialog() 中 m_Calling.LoadBitmaps (IDR_JPG1);
IDR_JPG1为一张导入的JPG图片。
结果Button显示为空白,什么都不显示,请问怎么回事?
[最优解释]
不支持JPG的吧,用bmp试试
[其他解释]
LoadBitmaps只支持位图文件,不支持JPG。同时该按钮属性应该设置为OWNER_DRAW
[其他解释]
是的,只支持bmp的
[其他解释]
CBitmapButton使用需要注意一些问题的CBitmapButton的使用
[其他解释]
改成 bmp文件了,按钮属性设置为OWNER_DRAW,早就设置了,可是还是不行哦,现在 回去这个button时出现错误 :
Program F:\xx\xx.exe
File:f:\dd\vctools\vc7libs\ship\atlmfc\src\wincore.cpp (我电脑中无此目录及文件)
line:379
for information on how your grogram can cause an assertion failure,see the Visual C++ documentation on asserts.
中止,重试,忽略 (三个Button)
[其他解释]
你要用4张图片作为资源Load进来
[其他解释]
// Load the bitmaps for this button.
pmyButton->LoadBitmaps(IDB_UP, IDB_DOWN, IDB_FOCUS, IDB_DISABLE);
// Resize the button to be the size of the bitmaps.
pmyButton->SizeToContent();