Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to extract RGB from integer color value
Message
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Miscellaneous
Thread ID:
00883934
Message ID:
00884315
Views:
13
I want to thank Sergey, George Trasker and Nick for their excellent answers. You guys make this forum a tremendous resource.

Thanks again!


>Hi Don,
>
>The color is stored in the format 0x00bbggrr. You can extract each part using VFP BIT* functions.
lnColor = GETCOLOR()
>lnRed   = BITAND(lnColor, 0xFF)
>lnGreen = BITAND(BITRSHIFT(lnColor,8), 0xFF)
>lnBlue  = BITAND(BITRSHIFT(lnColor,16), 0xFF)
>
>>Does anyone know how can I extract the individual RGB colors from the integer value returned by GETCOLOR()?
>>
>>For example, if I select a greenish-color in GETCOLOR() it returns 8421376. I need to stuff the individual into a charting ActiveX control on the form that requires the color in the RGB(x,y,z) format.
>>
>>TIA!
Previous
Reply
Map
View

Click here to load this message in the networking platform