|
-
Oct 23rd, 2002, 02:13 PM
#1
DirectX: surface.setForeColor
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???
-
Oct 23rd, 2002, 03:15 PM
#2
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)
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 23rd, 2002, 03:19 PM
#3
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...
-
Oct 23rd, 2002, 03:26 PM
#4
It's C++ talk 
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.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 23rd, 2002, 03:31 PM
#5
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....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|