主题:加载位图不成功 大家帮帮忙啊
我想动态的加载一个位图 代码如下 程序编译成功 但不能显示 各位大虾帮帮忙啊
CString strPath="E:\\1.bmp";
CClientDC dc(this);
CDC dcCompatible;
HBITMAP hbmp=(HBITMAP)::LoadImage(AfxGetInstanceHandle(),strPath,IMAGE_BITMAP,100,100,LR_LOADFROMFILE);
m_bitmap.m_hObject=hbmp;
dcCompatible.CreateCompatibleDC(&dc);
dcCompatible.SelectObject(&m_bitmap);
dc.BitBlt(0,0,800,600,&dcCompatible,0,0,SRCCOPY);
CString strPath="E:\\1.bmp";
CClientDC dc(this);
CDC dcCompatible;
HBITMAP hbmp=(HBITMAP)::LoadImage(AfxGetInstanceHandle(),strPath,IMAGE_BITMAP,100,100,LR_LOADFROMFILE);
m_bitmap.m_hObject=hbmp;
dcCompatible.CreateCompatibleDC(&dc);
dcCompatible.SelectObject(&m_bitmap);
dc.BitBlt(0,0,800,600,&dcCompatible,0,0,SRCCOPY);