I want to set the fore color of a surface in DirecX. But the parameter is a Long. Is it possible to calculate form RGB to Long Color??? Or how do I know what number the color Green is in Long???
Printable View
I want to set the fore color of a surface in DirecX. But the parameter is a Long. Is it possible to calculate form RGB to Long Color??? Or how do I know what number the color Green is in Long???
That would be 0000FF00h, but the Long value should be the same format as the windows COLORREF values, which in VB are too represented as Long. You can create those with the RGB function (I think)
Do you or anyone else know how to that ("You can create those with the RGB function")?
And what exactly do you mean by Windows COLORREF values??I'm not following you 100% here...
It's C++ talk :D
A COLORREF is just a Long, but it indicates that windows interprets it in a special way (as a color).
There is a VB function named RGB (I think, maybe it's Rgb, or some completly other name) that creates a Long from three Byte values.
So you would do
VB Code:
Dim clr As Long clr = Rgb 0, 255, 0 'Green
But I've never really used VB so I'm not sure.
Feeling a bit stupid now. Should have figured out that that was the way to do it...Have had a rough day, I think I will go to bed now...
Thank you CornedBee, you saved my day....