|
-
March 27th, 2000, 10:06 PM
#1
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
-
March 28th, 2000, 03:07 PM
#2
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
-
October 25th, 2000, 08:51 AM
#3
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
-
October 26th, 2000, 10:08 PM
#4
Re: Windows Common Dialog Color Component- RGB?
thanks, but it was an anceint post.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|