setWinldowRgn

CRgn(HRGN) SetWindowRgn setRgn{ CRgn rgnRect; CRgn rgnHole; //获取窗口大小 CRect rcWnd; GetWindowRect(&rcWnd); //创建区域 rgnRect.CreatRectRgn(0,22, rcWnd.Width(),

rWnd.Height()); rgnHole.CreateEllipticRgn(50, 50, 100, 100); //区域运算 rgnRect.CombineRgn(&rgnRect, &rgnHole, RGN_XOR); SetWindowRgn(rgnRect, TRUE); } setBmpRgn(int nID); {CClientDC dc(this); CBitmap bmp; bmp.LoadBitmap(nID);

CDC dcBmp; dcBmp.CreateCompatibleDC(&dc); CBitmap * pOldBmp = dcBmp.SelectObject(&bmp); CRect rcWnd; GetWindowRect(&rcWnd); //创建区域 rgnRect.CreatRectRgn(0,0, rcWnd.Width(),

rWnd.Height());

rgnRect.CreateRectRgn(nx, ny, nx+1, ny+1);

 

posted @ 2013-08-07 08:55  呵呵··  阅读(311)  评论(0编辑  收藏  举报