惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
博客园 - Franky
GbyAI
GbyAI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
博客园_首页
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recent Announcements
Recent Announcements
Scott Helme
Scott Helme
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
C
CERT Recently Published Vulnerability Notes
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Jina AI
Jina AI
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
L
LangChain Blog
L
LINUX DO - 最新话题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hacker News: Front Page
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
AI
AI
T
Troy Hunt's Blog
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
S
Secure Thoughts
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
S
Security @ Cisco Blogs
Cloudbric
Cloudbric
E
Exploit-DB.com RSS Feed
Attack and Defense Labs
Attack and Defense Labs

博客园 - James Wong

QQ在线代码生成器 - James Wong - 博客园 試試Cashfiesta CreateProcess&Shellexecute - James Wong - 博客园 XP系統下顯示窗體陰影 Domino學習筆記(11) Domino學習筆記(10) ERP推行實踐(10) Domino學習筆記(09) Domino學習筆記(08) ERP推行實踐(09) VB2005學習筆記(01) VB2005之全局鼠標鍵盤鉤子 ERP推行實踐(08) Domino學習筆記(07) ERP推行實踐(07) ERP推行實踐(06) ACCESS自動更新模式 ACCESS開發數據應用程序體會 從范例創建首個Lotus應用程序
GDI+的用處
James Wong · 2005-09-10 · via 博客园 - James Wong

使用gdi+畫了一個Label,支持陰影,圓形邊框,漸變背景,其中較重要的幾個應用

1/繪畫區域的獲得:

 Private Sub GetRoundRect()
       Dim gp As New GraphicsPath
        gp.StartFigure()
        gp.AddLine(PSL + RC, PST, PSL + RL - RC, PST)
        gp.AddArc(New RectangleF(PSL + RL - RC * 2, PST, RC * 2, RC * 2), 270, 90)
        gp.AddLine(PSL + RL, PST + RC, PSL + RL, PST + RW - RC)
        gp.AddArc(New RectangleF(PSL + RL - RC * 2, PST + RW - RC * 2, RC * 2, RC * 2), 0, 90)
        gp.AddLine(PSL + RL - RC, PST + RW, PSL + RC, PST + RW)
        gp.AddArc(New RectangleF(PSL, PST + RW - RC * 2, RC * 2, RC * 2), 90, 90)
        gp.AddLine(PSL, PST + RW - RC, PSL, PST + RC)
        gp.AddArc(New RectangleF(PSL, PST, RC * 2, RC * 2), 180, 90)
        gp.CloseFigure()
        m_RoundPath = gp.Clone
        gp.Dispose()
 End Sub
繪制區域:
          Dim ShadowRegion1 As Region = New Region(m_RoundPath)
                Dim Sbrush1 As New SolidBrush(Color.FromArgb(20, Color.Black))
                pe.Graphics.FillRegion(Sbrush1, ShadowRegion1)
                ShadowRegion1.Dispose()
創建漸變色刷:
    Private Sub CreateGradientBrushes()
        If Me.Width > 0 AndAlso Me.Height > 0 Then
            If Not (m_brush Is Nothing) Then m_brush.Dispose()
            m_brush = New LinearGradientBrush(Me.ClientRectangle, m_StartColor, m_EndColor, m_GradientMode)
        End If
    End Sub
繪製漸變區域:
            CreateGradientBrushes()
            e.Graphics.FillRegion(m_brush, New Region(m_RoundPath))

漂亮極了.