Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: mk sharma
  Where is mk sharma?
 mumbai
 India
 mk sharma
 Tags
Subject: RE: rgb value
Thread ID: 209705 Message ID: 209710 # Views: 2 # Ratings: 2
Version: Visual FoxPro 9 SP2 Category: General VFP Topics
Date: Tuesday, December 30, 2008 2:48:16 PM         
   


> hot calculate the value of RGB()
>
> rgbvalue=RGB(61,100,186)
>
> ?rgbvalue
>
> result = 12215357
>
> what is the calculation method to get the value 12215357
>
> warm regards,
> mk.

? 61 * 256 ^0 + 100 * 256^1 + 186 * 256^2


You can think 256^n as bitlshift 0,8,16. You can also see how it constructed converting the values to hex:

? transform(61,'@0') && red - rightmost byte
? transform(100,'@0')
? transform(186,'@0') && blue - leftmost byte
? 0xBA643D && remember red is rightmost


Cetin Basoz

ENTIRE THREAD

rgb value Posted by mk sharma @ 12/30/2008 2:41:02 PM
RE: rgb value Posted by Cetin Basoz @ 12/30/2008 2:48:16 PM
RE: rgb value Posted by Yousfi Benameur @ 12/30/2008 3:49:58 PM