- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use the RGB function to convert the red, green, blue colours to a rgb value.
I want to the the reverse.
There is an integertorgb function but it is for QuickWin and I want it for Win32 API.
There are also GetBvalue, GetGvalue & GetBvalue functions, are these the ones that I should use? If so, I am having trouble getting it to work.
Thanks,
David
I want to the the reverse.
There is an integertorgb function but it is for QuickWin and I want it for Win32 API.
There are also GetBvalue, GetGvalue & GetBvalue functions, are these the ones that I should use? If so, I am having trouble getting it to work.
Thanks,
David
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
RGB value in Win32 is defined as #00BBGGRR. GetRValue, RGB, MAKEINTRESOURCE and some more functions are
not "real" Win32 API functions; those are actually C macros which
are, AFAIK, expanded to real functions by Compaq/Digital and placed in dfwin.lib.
GetRValue, GetBValue and GetGValue are supposed to work, though I think (don't know if it's fixed in newer versions) Compaq forgot to include them in dfwin.lib. You can write them yourself (as real or statement functions ):
GetRVAlue(iRGB) = IAND(iRGB, #FF)
GetGValue(iRGB) = ISHL(IAND(iRGB,#FF00), -8)
GetBValue(iRGB) = ISHL(IAND(iRGB,#FF0000), -16)
RGB() macro/function does the inverse thing in Win32 (that one
is implemented in dfwin.lib). I prefer to use hex notation
when working with colors (i.e. #FF00FF means light pink) instead
of RGB macro -- but that's a matter of taste.
Regards
Jugoslav
not "real" Win32 API functions; those are actually C macros which
are, AFAIK, expanded to real functions by Compaq/Digital and placed in dfwin.lib.
GetRValue, GetBValue and GetGValue are supposed to work, though I think (don't know if it's fixed in newer versions) Compaq forgot to include them in dfwin.lib. You can write them yourself (as real or statement functions ):
GetRVAlue(iRGB) = IAND(iRGB, #FF)
GetGValue(iRGB) = ISHL(IAND(iRGB,#FF00), -8)
GetBValue(iRGB) = ISHL(IAND(iRGB,#FF0000), -16)
RGB() macro/function does the inverse thing in Win32 (that one
is implemented in dfwin.lib). I prefer to use hex notation
when working with colors (i.e. #FF00FF means light pink) instead
of RGB macro -- but that's a matter of taste.
Regards
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, that worked.
It is strange that GetRvalue, GetGvalue & GetBvalue are all missing from CVF v6.5.
David
It is strange that GetRvalue, GetGvalue & GetBvalue are all missing from CVF v6.5.
David

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page