源碼名稱:模仿酷狗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 (可直接下載)