Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
TitleBreak a RGB color into its red, green, and blue components
KeywordsRGB, color, components, separate
CategoriesGraphics
 

Thanks to ToitSoft

 
Public Sub ReverseRGB(ByVal Value As Long, Red As Integer, _
    Green As Integer, Blue As Integer)
Dim lngRed As Long
Dim lngGreen As Long
Dim lngBlue As Long

    lngBlue = Int(Value / 65536)
    lngGreen = Int((Value - (65536 * lngBlue)) / 256)
    lngRed = Value - ((lngBlue * 65536) + (lngGreen * 256))
    Red = lngRed
    Green = lngGreen
    Blue = lngBlue
End Sub
 
Formatted by Neil Crosby
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated