Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Color integer without the Alpha
Message
From
11/04/2008 13:35:42
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
11/04/2008 13:27:27
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01309975
Message ID:
01309992
Views:
21
Hi John,

>>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

The integer is a single integer and it is coming from a foxpro color. I am not sure about the order it was generated from but assumed it was standard RGB. I have the actual colors for some to compare once I find some kind of conversion but can't find any math or methods to let me do this yet.
Tim
Timothy Bryan
Previous
Reply
Map
View

Click here to load this message in the networking platform