GDI+ 问题
通过菜单执行以下语句正常:
CDC* pDC=GetDC();
Graphics graphics(pDC->m_hDC);
Image image(L"car.bmp");
CRect rect;
this->GetWindowRect(&rect);
Image* pThumbnail = image.GetThumbnailImage(rect.Width(), rect.Height(), NULL, NULL);
//绘制缩略图
graphics.DrawImage(pThumbnail, 0, 0, rect.Width()/2, rect.Height()/2);
而当把以上代码移植到 CView::OnDraw 时报错 C0000005,其中 DC 是使用 OnDraw 中的 pDC ,两者就这点区别
什么道理呀?