CClientDC *pDC = new CClientDC(GetDlgItem(IDC_PIC));
CRect rect;
GetDlgItem(IDC_PIC)->GetWindowRect(&rect);
Graphics graphics(pDC->m_hDC); // Create a GDI+ graphics object
Image image(_T("d:\\1.png")); // Construct an image
graphics.DrawImage(&image, 0, 0, image.GetWidth(), image.GetHeight());
delete pDC;
CWnd* pwnd = GetDlgItem(IDC_PIC);
CDC* dc = pwnd->GetDC();
CRect rect;
GetDlgItem(IDC_PIC)->GetWindowRect(&rect);
Graphics graphics(dc->m_hDC); // Create a GDI+ graphics object
Image image(_T("d:\\1.png")); // Construct an image
graphics.DrawImage(&image, 0, 0, image.GetWidth(), image.GetHeight());
ReleaseDC(dc);