Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RGB numbers
Message
De
10/03/2007 05:54:18
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
10/03/2007 05:28:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Divers
Thread ID:
01202501
Message ID:
01202503
Vues:
16
>This must be simple ...
>But my mind is stuck.
>
>nRgb=myLabel.forecolor
>nRed=?
>nGreen=?
>nBlue=?
>
>TIA

Right now, I can't find a simple function that just returns red, etc. I hope somebody else can help here.

Otherwise, do the following tests:
? rgb(0,0,1)
? rgb(0,1,0)
? rgb(1,0,0)
It seems that red, blue, and green are stored in three consecutive bytes, so the rgb() function returns red * 256^2 + blue * 256 + green.

From there, you should be able to extract the components with the division and modulus operators.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform