I have a 4 byte, unsigned number (it is an OLE_COLOR data) that I'd like to convert it to RGB format in the range 0-16777215
Anybody could suggest a function to do it?
Thanks
Rafael
I have a 4 byte, unsigned number (it is an OLE_COLOR data) that I'd like to convert it to RGB format in the range 0-16777215
Anybody could suggest a function to do it?
Thanks
Rafael
Rafael,
Try it this way:
nLoWord( nNumber ) + ( 256 * nHiWord( nNumber ) )
or doing:
nHiWord( nNumber ) + ( 256 * nLoWord( nNumber ) )
It depends on the bytes storage order