/显示位图
void CStringTestDlg::OnBnClickedBtnshowpic()
{
CClientDC dc(this);
dc.TextOutW(100,100,_T("hi mfc"));
CStatic* pStatic=(CStatic*)GetDlgItem(IDC_PIC);
CDC* pDC=pStatic->GetDC();
CBitmap bitmap;
bitmap.LoadBitmap(IDB_BITMAP2);
BITMAP bmp;
bitmap.GetBitmap(&bmp);
CDC dcCompatible;
dcCompatible.CreateCompatibleDC(pDC);
dcCompatible.SelectObject(&bitmap);
CRect rect;
pStatic->GetClientRect(&rect);
pDC->StretchBlt(0,0,rect.Width(),rect.Height(), &dcCompatible,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY);
// TODO: Add your control notification handler code here
}