VBGamer |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RE: Taking out Red, Green, and Blue from RGB Rag on a Stick (7 replies, 0 views) (2000-Sep-3) Ok, I often get this wrong, but here goes
Dim R as Integer
Dim G as Integer
Dim B as Integer
Colour = Whatever
R = Colour Mod 256
G = (Colour / 256) Mod 256
B = ((Colour / 256) / 256) Mod 256
Um, that could be optimised a lot, but for simplicity, it is that way, so suffer =) Yeah, some sort of bitshift would be quite appropriate here.
Also, I think there are some DDraw functions, such as GetRed, GetGreen and GetBlue which might do it also, although I've never used them.
hth
|