VS2013 GDI+显示png

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

你可能感兴趣的:(VS2013 GDI+显示png)