Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting Color Property Values to Text
Message
De
14/08/2002 08:43:34
 
 
À
14/08/2002 07:26:55
Herb Ellerbock
Customized Computer Systems
Australie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00689475
Message ID:
00689497
Vues:
31
The following works for me:
*FUNCTION GC2RGB
PARAMETERS p_nColor
PRIVATE l_nRed, l_nGreen, l_nBlue

IF PCOUNT() < 1 OR TYPE("p_nColor") <> "N"
    RETURN ""
ENDIF
IF !BETWEEN(p_nColor, 0, 256^3-1)
    RETURN ""
ENDIF

l_nRed = MOD(p_nColor, 256)
l_nGreen = MOD(INT(p_nColor/256), 256)
l_nBlue =  MOD(INT(p_nColor/(256*256)), 256)

RETURN "RGB("+ALLTRIM(STR(l_nRed));
 +","+ALLTRIM(STR(l_nGreen));
 +","+ALLTRIM(STR(l_nBlue))+")"
Rick

>Hello Everybody,
>
>I want to set the DynamicForeColor and DynamicBackColor Properties in a grid to the ForeColor and BackColor Properties of another object. This requires me to convert the ForeColor and BackColor Properties to text, e.g. RGB(0,0,128) to 'RGB(0,0,128)'.
>
>I would appreciate any help with how this can be done?
>
>Thanks,
>Herb
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform