Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reverse color of a shape
Message
 
 
À
09/03/2007 11:35:15
Bruno Maddalozzo
Informatica Aziendale
Arsie, Italie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01202325
Message ID:
01202329
Vues:
8
>I've the need to dermine the 'reverse' color of a shape to assign to a label, lying over the shape, in order to be able to read the content.
>I.e. a black color for a shape should give a white color for the label, a blu shape a yellow label and so on.
>
>The user can choose the back color of the shape and the label, automatically, should get the 'reverse color'.
>
>How can I get the result?
>TIA

Try
speccolor=Thisform.BackColor  
  	b=floor(speccolor/65536)  
  	g=floor((speccolor-m.b*65536)/256)  
  	r=floor(speccolor-m.b*65536-m.g*256)  
  	This.ForeColor=IIF(r+3*g+b>255*2.5,rgb(0,0,0),rgb(255,255,255))
From http://forum.foxclub.ru/read.php?29,254746,255048#msg-255048
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform