C++ does not load bitmap resources to display pictures

1 Create a new dialog box project, put a button and a Picture Control on the dialog box resource, and set the type of Picture Control to Bitmap

2 Implement button click event 


void CExam032702Dlg::OnBnClickedButton1()
{
	HANDLE handle=::LoadImage(NULL, _T("e:\\Image\\1.bmp"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
	m_bmp.SetBitmap((HBITMAP)handle);
}

 

Guess you like

Origin blog.csdn.net/dxm809/article/details/115262166