converting decimal to hexadecimal
-
Hi I wanted to create a function that takes 3 integer color values, between 0-255. The function uses a variable of the type COLORREF which is a hexadecimal value. How can I can convert the three decimal values into a COLORREF value; How can I make decimal 255, 0, 255 into 0x00ff00ff Thank you, SAK
-
Hi I wanted to create a function that takes 3 integer color values, between 0-255. The function uses a variable of the type COLORREF which is a hexadecimal value. How can I can convert the three decimal values into a COLORREF value; How can I make decimal 255, 0, 255 into 0x00ff00ff Thank you, SAK
The RGB macro converts three unsigned chars into a COLORREF value. The GetRValue, GetGValue, GetBValue macros pull them out again. COLORREF magenta = RGB(255,0,255); Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
-
The RGB macro converts three unsigned chars into a COLORREF value. The GetRValue, GetGValue, GetBValue macros pull them out again. COLORREF magenta = RGB(255,0,255); Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
-
I wouldn't make that into a function. Just use the macro as if it was a function. Sorry to dissapoint you all with my lack of a witty or poignant signature.
-
I wouldn't make that into a function. Just use the macro as if it was a function. Sorry to dissapoint you all with my lack of a witty or poignant signature.
Jon Hulatt wrote: I wouldn't make that into a function. Just use the macro as if it was a function. He's saying he's written a function which takes three unsgined chars and *uses* a COLORREF, not that it's point of existence is to create one. At least, I *hope* that was what he was saying.... Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now