mfc新人求助,CImage和CImageList使用出错
mfc吧
全部回复
仅看楼主
level 3
禁之子 楼主
2015年08月20日 13点08分 1
level 3
禁之子 楼主
代码如下:
//创建并显示缩略图区域
myImageList = new CImageList();
smallWidth = oldWidth* 0.2;
smallHeight = smallWidth * (rc.Height() / (double)rc.Width());
myImageList->Create(smallWidth,smallHeight,ILC_COLOR32,1,1);
//使用CImage类将内容显示DC中的内容绘制出来再添加在myImageList控件上
CImage tmpImage;
tmpImage.Create(smallWidth,smallHeight,24);
CDC* contentCdc;
CDC* myCdc;
contentCdc = myStatic.GetDC();
myCdc = CDC::FromHandle(tmpImage.GetDC());
myCdc->BitBlt(0,0,smallWidth,smallHeight,contentCdc,0,0,SRCCOPY);
//tmpImage.Save(_T("D:\\hh.jpg"));
//tmpImage.Destroy();
HBITMAP hBitmap;
CBitmap* pBitmap;
hBitmap=(HBITMAP) tmpImage.Detach();
//执行到这里的时候出错,求大神指导,什么问题呀?谢谢~
2015年08月20日 13点08分 2
1