资源介绍
CPaintDC dc(this);
CWnd * pWnd = dc.GetWindow();
CWnd * item1;
item1=this->GetDlgItem(IDC_STATIC1);
CRect * rect=new CRect;
item1->GetWindowRect(rect);
POINT a,b;
a=rect->TopLeft();
b=rect->BottomRight();
::ScreenToClient(this->m_hWnd,&a);
::ScreenToClient(this->m_hWnd,&b);
CDC memDC;
CBitmap cBitmap;
BITMAP bitmap;
cBitmap.LoadBitmap(IDB_BITMAP2); //通过资源标识加载图片
// HBITMAP hbmp=(HBITMAP)::LoadImage(AfxGetInstanceHandle(),"F:\\MFC\\duilian2\\res\\下联.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
//通过文件路径加载图片
// cBitmap.Attach(hbmp);
cBitmap.GetBitmap(&bitmap);
maxh=bitmap.bmHeight;
memDC.CreateCompatibleDC(&dc);
memDC.SelectObject(&cBitmap);
dc.BitBlt(a.x,a.y,bitmap.bmWidth,bitmap.bmHeight,&memDC,0,0,SRCCOPY);
////////////////////////////////////////////////////////////////////////////
CRgn rgn,temprgn;
rgn.CreateRectRgn(a.x,a.y,a.x+bitmap.bmWidth+5,a.y+h+4);
item1=this->GetDlgItem(IDC_STATIC2);
item1->GetWindowRect(rect);
a=rect->TopLeft();
b=rect->BottomRight();
::ScreenToClient(this->m_hWnd,&a);
::ScreenToClient(this->m_hWnd,&b);
cBitmap.DeleteObject();
cBitmap.LoadBitmap(IDB_BITMAP1);
cBitmap.GetBitmap(&bitmap);
// memDC.CreateCompatibleDC(&dc);
memDC.SelectObject(&cBitmap);
dc.BitBlt(a.x-1,a.y-2,bitmap.bmWidth,bitmap.bmHeight,&memDC,0,0,SRCCOPY);
temprgn.CreateRectRgn(a.x,a.y,a.x+bitmap.bmWidth+4,a.y+h+4);
rgn.CombineRgn(&rgn,&temprgn,RGN_OR);
///////////////////////////////////////////////////////////////////////////////////////
item1=this->GetDlgItem(IDC_STATIC3);
item1->GetWindowRect(rect);
a=rect->TopLeft();
b=rect->BottomRight();
::ScreenToClient(this->m_hWnd,&a);
::ScreenToClient(this->m_hWnd,&b);
cBitmap.DeleteObject();
cBitmap.LoadBitmap(IDB_BITMAP3);
cBitmap.GetBitmap(&bitmap);
maxw=bitmap.bmWidth;
// memDC.CreateCompatibleDC(&dc);
memDC.SelectObject(&cBitmap);
dc.BitBlt(b.x-2-bitmap.bmWidth,a.y-2,bitmap.bmWidth,bitmap.bmHeight,&memDC,0,0,SRCCOPY);
temprgn.DeleteObject();
temprgn.CreateRectRgn(b.x-w,a.y,b.x,a.y+bitmap.bmHeight);
rgn.CombineRgn(&rgn,&temprgn,RGN_OR);
///////////////////////////////////////////////////////////////////////////////
pWnd->SetWindowRgn(rgn,true);
// pWnd->SetForegroundWindow();
rgn.DeleteObject();
temprgn.DeleteObject();
SetTimer(0,15,NULL);
//CDialog::OnPaint();
- 上一篇: 在线客服系统 开源免费版
- 下一篇: 易语言源码易语言将桌面嵌入窗口源码.rar