Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Color integer without the Alpha
Message
De
11/04/2008 13:35:42
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
11/04/2008 13:27:27
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01309975
Message ID:
01309992
Vues:
20
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform