如何根据按下的按钮显示位图图像? [英] How to display the bitmap image according to the button pressed?
本文介绍了如何根据按下的按钮显示位图图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在对话框中显示位图图像。我第一次按下按钮时会显示图像。下次当我按下时,它显示构建断言失败错误。
这是添加按钮点击功能。
Im trying to display the bitmap image in the dialog box. First time when i press the button it displays the image. Next time when i press, it shows the build assertion failed error.
This is the add button click function.
void CsampleStudDlg::OnBnClickedAdd()
{
UpdateData();
Bmp.LoadBitmap(IDB_ADD);
m_Picture.SetBitmap(Bmp);
UpdateData(FALSE);
}
我需要做的是,每按一下按钮就会显示图像。
在此先感谢..
what i need to do is, to display the image whenever i press that button.
Thanks in advance..
推荐答案
解决方案是
The solution is
void CsampleStudDlg::OnBnClickedAdd()
{
UpdateData();
Bmp.LoadBitmap(IDB_ADD);
m_Picture.SetBitmap(Bmp);
Bmp.DeleteObject();
UpdateData(FALSE);
}
感谢CPallini。
Thanks to CPallini.
这篇关于如何根据按下的按钮显示位图图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文