|
-
Nov 7th, 2000, 11:02 AM
#1
Thread Starter
Hyperactive Member
Hi guys!!!
How can I convert a RGB value to hexadecimal and viceversa?
-
Nov 7th, 2000, 12:14 PM
#2
Addicted Member
It seems that VB uses a 4-byte long integer to represent color, the high byte being 0 and the three lower bytes being, from lowest onward, RRGGBB, i.e., &HBBGGRR. So RGB(255,255,255) = &HFFFFFF; RGB(123,0,33) = &H21007B, and so on. &H80 in the high byte represents a Windows system color.
Hope it helps.
-
Nov 7th, 2000, 12:20 PM
#3
Fanatic Member
A little addition
You can easily convert numbers into hex using either the Hex() (returns variant), or Hex$() (returns a string) functions. Converting from hex to some other base requires an algorithm however. If you really want it, I have one, but if you look you can probably find one faster than I can dig mine up at home .
I'm baaaack...
VB5 Professional Edition, VC++ 6
Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se
I feel special because I finally figured out how to loop midis: Post link
I'm a fanatic too 
-
Nov 8th, 2000, 09:26 AM
#4
Thread Starter
Hyperactive Member
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
|