国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
windows編程——背景圖片和透明特效的使用3
自繪實現(xiàn)半透明水晶按鈕
運行效果
實現(xiàn)方法
1.給按鈕加上BS_OWNERDRAW樣式
2.重載DrawItem函數(shù),在這里繪制按鈕
3.關(guān)鍵之處就是把父窗口的背景復(fù)制到按鈕上,實現(xiàn)視覺上的透明
4.最后通過AlphaBlend實現(xiàn)半透明.
源碼下載:
http://blog.csdn.net/cometnet/article/details/8464693
實現(xiàn)源碼
C/C++ code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// MyButton.h
#pragma once
// CMyButton
class CMyButton : public CButton
{
DECLARE_DYNAMIC(CMyButton)
public:
CMyButton();
virtual ~CMyButton();
public:
void SetBkColor(COLORREF color);
void SetTextColor(COLORREF color);
private:
bool m_bOver;
bool m_bDown;
bool m_bDisable;
bool m_bTracking;
COLORREF m_bkColor;
COLORREF m_textColor;
protected:
DECLARE_MESSAGE_MAP()
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void PreSubclassWindow();
public:
virtual void DrawItem(LPDRAWITEMSTRUCT /*lpDrawItemStruct*/);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg LRESULT OnMouseLeave(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnMouseHover(WPARAM wParam, LPARAM lParam);
afx_msg void OnEnable(BOOL bEnable);
private:
void ButtonInit();
void DrawButton();
void DrawButton(HDC hDestDC);
};
(###)
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
靜態(tài)文本 鏈接控件 背景透明的靜態(tài)文本
CListCtrl 的customdraw和ownerdraw
MFC消息
VC超級鏈接的設(shè)計與實現(xiàn)
如何設(shè)置自定義按鈕的樣式
VC6向VC9 移植時常見BUG 2
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服