关闭

VS2013 GDI+显示png

586人阅读 评论(0) 收藏 举报
分类:
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);
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:690092次
    • 积分:10697
    • 等级:
    • 排名:第1505名
    • 原创:443篇
    • 转载:80篇
    • 译文:1篇
    • 评论:113条
    最新评论