|
Thread: rgb
-
Feb 6th, 2002, 11:36 AM
#1
Thread Starter
Lively Member
rgb
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
-
Feb 6th, 2002, 11:52 AM
#2
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:
Code:
dim b as byte
b = color And &h1F
Ill let you explore from there, as I have to run.
Z.
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
|