Windows Common Dialog Color Component- RGB?
I am using the Widows common dialogs control and I dont understand the integer that is returned from showcolor. The integer is not in RGB format or anything else that I can decipher. After reviewing the vbhelp it told me to set the flag &h0(not 100% sure but thats not imp.) anyway... does anyone know how to convert the returned integer into rgb or at least tell me how to read it. Thanks
Re: Windows Common Dialog Color Component- RGB?
Hi,
I'll try to explain this with an example.
'setting up default color
cdlDialog.Color = vbRed
cdlDialog.Flags = cdlCCRGBInit 'Flags see end of page
cdlDialog.ShowColor 'Brings up the Color Window
form1.backcolor = cdlDialog.Color 'cdlDialog.Color = the selected color
Exit Sub
Flags:
Constants value
cdlCCRGBInit 1 Defaultcolor
cdlCCFullOpen 2 Show the entire dialogwindow
cdlCCPreventFullOpen 4 Disable the button 'define ... colors'
cdlCCShowHelp 8 Show the 'Help' button in the color window
So I hope this could have helped you, good luck.
Cannibal
Re: Windows Common Dialog Color Component- RGB?
Hi, I am writing my own version of this control an included is the individual components of the the value returned.
To get each value you try this.
Red = (ColorValue MOD 256)
Green = ((ColorValue AND &HFF00FF00) / 256&)
Blue = (ColorValue AND &HFF0000) /65536
Re: Windows Common Dialog Color Component- RGB?
thanks, but it was an anceint post.