|
-
Nov 19th, 2002, 05:18 PM
#1
Thread Starter
Hyperactive Member
common dialog
how do i set the .Color property of the common dialog? sounds simple but i dont know what format it uses..
cheers
-
Nov 19th, 2002, 05:28 PM
#2
Stuck in the 80s
VB Code:
CD.color = RGB(r, g, b)
CD.color = vbGreen
There are many ways.
-
Nov 19th, 2002, 05:36 PM
#3
Thread Starter
Hyperactive Member
cheers but i got 1 more problem :P is this the only way to retrieve the colours from the dialog:
VB Code:
Red = cdlColour.Color And &HFF
Green = (cdlColour.Color \ &H100) And &HFF
Blue = cdlColour.Color \ &H10000
-
Nov 19th, 2002, 05:52 PM
#4
Good Ol' Platypus
No. This is a much more convenient way:
VB Code:
Private Type mLong
L As Long
End Type
Private Type mRGB
R As Byte
G As Byte
B As Byte
RESERVED As Byte
End Type
Private Function GetRGB(Co As Long) As mRGB
Dim Q As mLong
Q.L = Co
LSet GetRGB = Q
End Function
'// USAGE:
Dim Q As mRGB
Q = GetRGB(cdlColour.Color)
Msgbox Q.R
Msgbox Q.G
Msgbox Q.B
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Nov 19th, 2002, 06:51 PM
#5
Thread Starter
Hyperactive Member
thats a bit complex and i havent got a clue what it does :P aint there any other more simple ways of gettin it done?
cheers
-
Nov 19th, 2002, 07:26 PM
#6
Good Ol' Platypus
No, this is pretty complicated. It has to be. Sure, if you were in C/C++, you could just shift bits to get the answer. But we can't. If you stick in mine, all you need is two lines of code to get it the RGB value. And it's fast
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
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
|