当前位置:编程学习 > 网站相关 >>

简单方法创建透明区域

 CRect areaRect(0, 0, 0, 0);
 CRect clientRect(0, 0, 0, 0);
 GetClientRect(&clientRect);
 CWnd* pWnd = GetDlgItem(IDC_STATIC_TRANS);
 if(pWnd && IsWindow(pWnd->m_hWnd))
 {
  pWnd->GetWindowRect(&areaRect);
  ScreenToClient(areaRect);
  CRgn crRgn, crRgnTmp;
  crRgn.CreateRectRgn(clientRect.left, clientRect.top, clientRect.right, clientRect.bottom);
  crRgnTmp.CreateRectRgn(areaRect.left, areaRect.top, areaRect.right, areaRect.bottom);
  crRgn.CombineRgn(&crRgn, &crRgnTmp, RGN_XOR);
  crRgnTmp.DeleteObject();
  SetWindowRgn(crRgn, FALSE);
  crRgn.DeleteObject();
 }
补充:综合编程 , 其他综合 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,