Results 1 to 2 of 2

Thread: rgb

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Location
    england
    Posts
    87

    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

  2. #2
    Zaei
    Guest
    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
  •  



Click Here to Expand Forum to Full Width