I have attempted to find a color converter to convert colors like &H00C0C000& to RGB values. anyone know of anything?
Added green "resolved" checkmark - Hack
Printable View
I have attempted to find a color converter to convert colors like &H00C0C000& to RGB values. anyone know of anything?
Added green "resolved" checkmark - Hack
This?VB Code:
'Example by Bertrand DUMAS-PILHOU ([email protected]) Private Declare Function TranslateColor Lib "olepro32.dll" Alias "OleTranslateColor" (ByVal clr As OLE_COLOR, ByVal palet As Long, col As Long) As Long Private Sub Form_Load() Dim RealColor As Long 'Convert OLE colors to RGB colors TranslateColor Me.BackColor, 0, RealColor 'show the result MsgBox "The backcolor of this form is R=" + CStr(RealColor And &HFF&) + " G=" + CStr((RealColor And &HFF00&) / 2 ^ 8) + " B=" + CStr((RealColor And &HFF0000) / 2 ^ 16) End Sub
awesome. thanks
Why use a whole API when you can do it in 4 bitwise operations...
VB Code:
red = rgbValue And &HFF& green = (rgbValue And &HFF00&) \ &HFF& blue = rgbValue \ &HFF00&
Much more efficient :)
Where to write this code in a load event or for command buuton?Quote:
Originally Posted by penagate
Wherever you want. How should I know?