>>>Anybody got experience with Colors? I have a database with colors as integers that I need to display the colors. The problem is they are RGB and not ARGB. When I use Color.FromArgb(int) I get a different color. If I try to break out the colors using color.A, color.R, color.G, and color.B I get values in the alpha part that I assume should be 255 if anything.
>>>
>>>The color.FromArgb() method is overloaded to allow me to create a color using only the RGB, but I can't find anything that allows me to extract a matching color from a single 24 bit RGB integer.
>>>Thanks for any help.
>>>Tim
>>
>>I'm assuming the data source is a single int, not an array of ints correct?
>>
>>Just out of curiosity... try RGBx instead of xRGB.
>>
>>Also if the data was created in c a byte array may have been used to create the int so the unused byte may not have been initialized and my contain garbage.
>>
>>Also it may be stored as BGRx or xBGR see
http://www.javaworld.com/javaworld/javatips/jw-javatip43.html>
>I just found the answer; it was there all along.
>Color myColor = System.Drawing.ColorTranslator.FromOle(rgbint);
>
>Works perfect!
>Tim
Cool, glad you found it. BTW... I think VFP uses the xBGR format.
? RGB(1,0,0) = 1
? RGB(0,1,0) = 256
? RGB(0,0,1) = 65536