Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting Color Values
Message
 
To
02/10/2001 12:42:22
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00563099
Message ID:
00563137
Views:
20
Try this:

FUNCTION NUM2RGB(znCOLOR, znQUEL)
** EX : znCOLOR = RBG(xxx,xxx,xxx)
** znQUEL = 1 - RED ** 2 - Green ** 3 - Blue

IF EMPTY(znQUEL)
RETURN 0
ELSE
DO CASE
CASE znQUEL = 1
RETURN (znCOLOR % 256)
CASE znQUEL = 2
RETURN INT((znCOLOR % 65536) / 256)
CASE znQUEL = 3
RETURN INT(znCOLOR / 65536)
ENDCASE
ENDIF
RETURN 0
ENDFUNC

Best regards
Le travail est un moyen, pas une fin.

Louis Hudon
Hydro-Québec
Informatique en Équipement
Previous
Reply
Map
View

Click here to load this message in the networking platform