请帮助看看这个函数做什么的(已知了,谢谢)
在一本书上看了这个函数,看了半天不知做什么,请高手帮我解析一下,各个代码的意思和实现什么!?谢谢void TransparentBlt2( HDC hdc0, // 目标DC
int nX0,int nY0,// 目标偏移
int nW0,int nH0,// 目标宽高度
HDC hdc1, // 源DC
int nX1,int nY1,// 源起点
int nW1,int nH1,// 源宽高度
UINT Tcol )
{
HBITMAP hBMP =CreateCompatibleBitmap(hdc0,nW0, nH0); //创建位图内存
HBITMAP mBMP =CreateBitmap(nW0,nH0,1,1,NULL);
HDC hDC =CreateCompatibleDC(hdc0); //创建设备句柄
HDC mDC =CreateCompatibleDC(hdc0); //创建设备句柄
HBITMAP oldBMP =(HBITMAP)SelectObject(hDC, hBMP);
HBITMAP oldmBMP=(HBITMAP)SelectObject(mDC, mBMP);
if (nW0==nW1&&nH0==nH1)
BitBlt(hDC,0,0,nW0,nH0,hdc1,nX1,nY1,SRCCOPY);
else
StretchBlt(hDC,0,0,nW0,nH0,hdc1,nX1,nY1,nW1,nH1,SRCCOPY);
SetBkColor(hDC, Tcol);
BitBlt(mDC,0,0,nW0,nH0,hDC,0,0,SRCCOPY);
SetBkColor(hDC, RGB(0,0,0));
SetTextColor(hDC, RGB(255,255,255)); // 白色
BitBlt(hDC,0,0,nW0,nH0,mDC,0,0,SRCAND);
SetBkColor(hdc0,RGB(255,255,255));
SetTextColor(hdc0,RGB(0,0,0));
BitBlt(hdc0,nX0,nY0,nW0,nH0,mDC,0,0,SRCAND);
BitBlt(hdc0,nX0,nY0,nW0,nH0,hDC,0,0,SRCPAINT);
SelectObject(hDC, oldBMP);
DeleteDC(hDC);
SelectObject(mDC, oldmBMP);
DeleteDC(mDC);
DeleteObject(hBMP);
DeleteObject(mBMP);
}
[[it] 本帖最后由 sunstudent 于 2008-4-15 15:54 编辑 [/it]]