源码名称:模仿酷狗7(Kugou7)界面源码 php
源码做者:邓学彬(泪闯天涯) html
源码说明:内含VC++源码、易语言源码各一份.包含全部图片源码(使用Fireworks编辑) api
开发环境:VC版--VS200五、Gdiplus;易语言版--易语言5,无模块 spa
实现方法:给窗口加上WS_EX_LAYERED样式,使用Gdiplus画出图片,而后UpdateLayeredWindow。处理WM_MOUSEHOVER、WM_MOUSELEAVE消息,鼠标进入或移出画出不一样状态。 .net
注意事项:只是实现初步模仿而已,未响应子控件操做,若是你们有兴趣就接着完善吧。 code
主要源码: orm
void CKugouUIDlg::DrawUI(void) { HDC hDC=::GetDC(m_hWnd); HDC hMemDC=::CreateCompatibleDC(hDC); BITMAPINFO bitmapinfo; bitmapinfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bitmapinfo.bmiHeader.biBitCount = 32; bitmapinfo.bmiHeader.biHeight = m_KugouUI.height; bitmapinfo.bmiHeader.biWidth = m_KugouUI.width; bitmapinfo.bmiHeader.biPlanes = 1; bitmapinfo.bmiHeader.biCompression=BI_RGB; bitmapinfo.bmiHeader.biXPelsPerMeter=0; bitmapinfo.bmiHeader.biYPelsPerMeter=0; bitmapinfo.bmiHeader.biClrUsed=0; bitmapinfo.bmiHeader.biClrImportant=0; bitmapinfo.bmiHeader.biSizeImage = bitmapinfo.bmiHeader.biWidth * bitmapinfo.bmiHeader.biHeight * bitmapinfo.bmiHeader.biBitCount / 8; HBITMAP hBitmap=::CreateDIBSection (hMemDC,&bitmapinfo, 0,NULL, 0, 0); HBITMAP hOldBitmap = (HBITMAP)::SelectObject (hMemDC,hBitmap); Graphics g(hMemDC); //画出各个界面元素---------------------- DrawItem(&g,m_KugouUI.left); DrawItem(&g,m_KugouUI.top); DrawItem(&g,m_KugouUI.right); DrawItem(&g,m_KugouUI.bottom); DrawItem(&g,m_KugouUI.main); for(int i=0;i<4;i++) DrawItem(&g,m_KugouUI.Item[i]); //设置透明窗口------------------------------------------------- CPoint DestPt(0,0); CSize psize(m_KugouUI.width,m_KugouUI.height); BLENDFUNCTION blendFunc32bpp; blendFunc32bpp.AlphaFormat = AC_SRC_ALPHA; blendFunc32bpp.BlendFlags = 0; blendFunc32bpp.BlendOp = AC_SRC_OVER; blendFunc32bpp.SourceConstantAlpha = 255; ::UpdateLayeredWindow(m_hWnd,hDC,NULL,&psize,hMemDC,&DestPt,0,&blendFunc32bpp,ULW_ALPHA); //释放资源------------------------------------------------- ::SelectObject (hMemDC,hOldBitmap); ::DeleteObject(hBitmap); ::DeleteDC(hMemDC); ::ReleaseDC(m_hWnd,hDC); }
源码下载: htm
CSDN下载:http://download.csdn.net/source/3386452 (须要1积分) 图片
易语言论坛下载:http://bbs.eyuyan.com/read.php?tid=269124 (须要注册登陆) ip
源码爱好者下载:http://www.codefans.net/soft/13933.shtml (可直接下载)