how do i get the rgb values from a 16 bit pixel ?
i know its rrrrr gggggg bbbbb
is there a shift operator to shift the bits to the left and right ?
&h is hexa
&o us octa
but how do i use binary ???
please advise
Printable View
how do i get the rgb values from a 16 bit pixel ?
i know its rrrrr gggggg bbbbb
is there a shift operator to shift the bits to the left and right ?
&h is hexa
&o us octa
but how do i use binary ???
please advise
Ok, take a look at this. 16 bits is two bytes: B B. each byte is, of course, 8 bits: 0000 0000. Now, lets take a look a the lower byte:
GGG BBBBB. In hexidecimal, 256 is &hFF. You want to find the hexidecimal value for 000 11111. I checked, and it is &h1F. To get the BLUE part of a 16 bit color, do this:
Ill let you explore from there, as I have to run.Code:dim b as byte
b = color And &h1F
Z.