LoadFromResource,只能加载BMP格式的图片
CImage::LoadFromResource() is a very thin wrapper around the LoadImage API
示例:
onpaint()中:
HINSTANCE hIns = AfxGetInstanceHandle();
m_img.LoadFromResource(hIns,IDR_PIC);
m_img.StretchBlt(dc,CRect(0,0,m_img.GetWidth(),m_img.GetHeight()),CRect(0,0,m_img.GetWidth(),m_img.GetHeight()),SRCCOPY);