Click here to Skip to main content
11,413,961 members (71,662 online)
Click here to Skip to main content
Add your own
alternative version

A Reflective and Translucent Glass Panel

, 1 Oct 2008 CPOL
Component derived from Panel that acts like a window (glass)
glasspanel_src.zip
Glass.suo
Glass
Components
GlassPanel.vbproj.user
Helpers
My Project
Application.myapp
Settings.settings
Test
GlassPanelTest.vbproj.user
My Project
Application.myapp
Settings.settings
Imports System.Drawing

Module Colors

    Public Function Darken(ByVal Color As Color) As Color
        Return Drawing.Color.FromArgb(Color.A, DeductMinZero(Color.R, 20), DeductMinZero(Color.G, 20), DeductMinZero(Color.B, 20))
    End Function

    Public Function Lighten(ByVal Color As Color) As Color
        Return Drawing.Color.FromArgb(Color.A, AddMax255(Color.R, 20), AddMax255(Color.G, 20), AddMax255(Color.B, 20))
    End Function

    Public Function DeductMinZero(ByVal Value As Integer, ByVal Deduction As Integer) As Integer
        If Value - Deduction < 0 Then
            Return 0
        Else
            Return Value - Deduction
        End If
    End Function

    Public Function AddMax255(ByVal Value As Integer, ByVal Addition As Integer) As Integer
        If Value + Addition > 255 Then
            Return 255
        Else
            Return Value + Addition
        End If
    End Function


End Module

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Nicolas Wälti
Software Developer (Senior)
Switzerland Switzerland
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150427.2 | Last Updated 1 Oct 2008
Article Copyright 2008 by Nicolas Wälti
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid