我有一个程序,是从msdn的例子drawcli改过来的,使用勒它里面的一些类,
我把画椭圆对象的函数改成画图标,也就是画一个透明位图,而这个透明位图的来源是图标文件,代码如下: CRect rect = m_position;
HICON hicon;
hicon = this->icon;
ICONINFO iconinfo;
HBITMAP andbm,xorbm;
CDC anddc,xordc,tmpdc;case ellipse:
           GetIconInfo(hicon,&iconinfo);
andbm = iconinfo.hbmMask;
xorbm = iconinfo.hbmColor;

anddc.CreateCompatibleDC(pDC);
anddc.SelectObject(andbm);
xordc.CreateCompatibleDC(pDC);
xordc.SelectObject(xorbm);
tmpdc.CreateCompatibleDC(pDC);


pDC->StretchBlt(rect.left,rect.top,nWidth,nHeight,&xordc,0,0,32,32,SRCINVERT);
pDC->StretchBlt(rect.left,rect.top,nWidth,nHeight,&anddc,0,0,32,32,SRCAND);
pDC->StretchBlt(rect.left,rect.top,nWidth,nHeight,&xordc,0,0,32,32,SRCINVERT);
break;
现在的问题是:
图标对象的绘制正常,但是为什么我在对这个图标对象进行拖动操作一段时间后,图像会丢失,就像黑板上的字被黑板擦擦掉一样???!而之前无论怎么拖动都很正常,实在是困惑,也不知道该怎么调试!!