|
-
Apr 16th, 2004, 08:47 AM
#1
Thread Starter
Fanatic Member
How to convert RGB to Hex and vice versa
Can anyone tell me how to convert hexidecimal to RGB and RGB to hexidecimal
-
Apr 16th, 2004, 09:15 AM
#2
New Member
are you talking about the given values? like R=255, G=0, B=0 makes the color Red? if so, then there really isn't a need for conversion. just a need to see the information in a different state. 255 =#FF=100% red. 0=#00=0%Green etc..
instead of displaying as a number, display as a hex.
-
Apr 16th, 2004, 09:45 AM
#3
Thread Starter
Fanatic Member
So how do I convert the vales like 255 into hex in code.
-
Apr 16th, 2004, 01:32 PM
#4
New Member
Here is what is available from the search function in VB
*
Example
This example uses the Hex function to return the hexadecimal value of a number.
Dim MyHex As String
MyHex = Hex(5) ' Returns 5.
MyHex = Hex(10) ' Returns A.
MyHex = Hex(459) ' Returns 1CB.
*
just reference the 5, or 10, or 459 in the above example to an integer for that specific color.
-
Apr 17th, 2004, 06:46 PM
#5
Frenzied Member
If you need an ARGB value there is a method in the color class that is called "ConvertFromHtml" ot something like that, I don't have dev studio right now, just pass the hex code and it will serve you an argb color object....
kind regards
Henrik
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
|