Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Constants using hex
Message
De
19/03/2008 18:13:55
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
À
19/03/2008 17:19:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01303578
Message ID:
01303692
Vues:
13
Carlos,

You are correct. Cesar was faster with the answer though :) Removing the first FF get the job done.

Thanks for the reply

Mike

>>I'm using the free RMChart control to show display a graph in a VFP form. This activeX control has a method that accepts a color as a parameter. There are no VFP samples provided. The PowerBasic example includes a file similar to that of a VFP include file. In it there are constants defined like:
>>
>>' Color constants
>>%ColorAliceBlue=&HFFF0F8FF
>>%ColorAntiqueWhite=&HFFFAEBD7
>>
>>I'm trying to convert this to VFP syntax and store it in a rmchart.h file. I'm trying the following:
>>
>>* Color constants
>>#DEFINE ColorAliceBlue ???
>>#DEFINE ColorAntiqueWhite ???
>>
>>Now what should I put into the ??? part?
>>
>>I'd like to call the control's method as follows:
>>
>>object.SetProperties("Up-to-date Rating", ColorAliceBlue, , 10, .T.)
>>
>>Any help is appreciated. TIA
>>
>>Mike
>
>As Bo and Sergey told you, &HFFF0F8FF in VFP is expressed as 0xFFF0F8FF.
>
>Using my psychic debugging powers á la Raymond Chen, I can guess that the problem is:
>
>0xFFF0F8FF in the context you present indicates an RGB color, but maybe 0xFFF0F8FF is really an ARGB color, where the first 2 hex digits indicate the Alpha trasparency, as in:
>
>ALPHA=FF, R=F0, G=F8, B=FF
>
>This may be confirmed by checking some color values in the RMC_Colors Enumeration:
>
>RED: &HFFFF0000
>GREEN: &HFF008000
>LIME: &HFF00FF00 (I thought this was green, when did this change?)
>BLUE: &HFF0000FF
>
>If we just remove the starting presumed Alpha channel value of FF, we get the proper values for the named colors:
>
>RED: 0xFF0000
>GREEN: 0x008000
>LIME: 0x00FF00
>BLUE: 0x0000FF
>
>The fact that all the colors start with FF reinforces the hypothesis that we have a fixed 0% transparent Alpha channel value.
>
>Carlos
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform