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);

posted on 2013-04-22 01:07  ximenchuixie  阅读(1480)  评论(0)    收藏  举报