Click here to Skip to main content
13,152,454 members (42,794 online)
Click here to Skip to main content

Stats

56.9K views
5K downloads
50 bookmarked
Posted 1 Oct 2008

A Reflective and Translucent Glass Panel

, 1 Oct 2008
Component derived from Panel that acts like a window (glass)
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

You may also be interested in...

Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170924.2 | Last Updated 1 Oct 2008
Article Copyright 2008 by Nicolas Wälti
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid