It just basically means using bitmasks and shifts. Since shifts aren't possible in VB, you have to simulate them with division. This code will get you the red, green and blue parts from a 32-bit colour value:
If you wanted the alpha too, it would be (Colour \ 16777216 And 255).Code:Red = Colour And 255 Green = Colour \ 256 And 255 Blue = Colour \ 65536 And 255
In case you hadn't noticed:
256 = 2^8
65536 = 2^16
16777216 = 2^24




Reply With Quote