//自定义绘制
CDC* cdc = GetDC(); //前台DC
CDC bufferDC; //后台DC
CDC tempDC; //临时DC
CBitmap bufferBMP; //后台DC位图
//DC关联
bufferDC.CreateCompatibleDC(cdc);
tempDC.CreateCompatibleDC(cdc);
//后台DC位图关联
bufferBMP.CreateCompatibleBitmap(cdc,278,127);
bufferDC.SelectObject(bufferBMP);
tempDC.SelectObject(m_bmp);
bufferDC.TransparentBlt(0,0,278,127,&tempDC,0,0,278,127,RGB(255,255,255));
//绘制到前台DC
cdc->BitBlt(0,0,278,127,&bufferDC,0,0,SRCCOPY);
//释放资源
bufferBMP.DeleteObject();
tempDC.DeleteDC();
bufferDC.DeleteDC();
this->ReleaseDC(cdc);
posted on 2010-03-18 15:27
漂漂 阅读(1825)
评论(0) 编辑 收藏 引用 所属分类:
深入vc++