Thread: Get RGB values with second way

  1. #1
    Registered User
    Join Date
    Jul 2006

    Get RGB values with second way

    Its very important, is possible to get RGB values or Pixels or Grey values from a pic without load it in Picture or Image box and use:
    Image1->Canvas->Pixels[x][y] method?? Is any other way from the above??
    Lets say choose the file and open it with a way and get the values??
    Is possible that?? Any ideas or code??

  2. #2
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Loading the image and displaying it onto an HDC it the only way I know.

  3. #3
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Load the image into a buffer. Given it's in RAW RGB form it's quite simple to get the values. If not you will have to decompress it to get the RGB values.

  4. #4
    Join Date
    Jan 2002
    You can use GetDIBits to retrieve the bitmap data and evaluate it as described by Bubba.

    There's an example by anonytmouse in this thread that may be of some interest. A further board search on this subject should provide more information/examples.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OpenGL: Pixel addition
    By Hunter2 in forum Game Programming
    Replies: 4
    Last Post: 12-15-2008, 02:36 PM
  2. Replies: 1
    Last Post: 12-30-2007, 10:08 AM
  3. How to read out the RGB values of an image?
    By pjeremy in forum C Programming
    Replies: 5
    Last Post: 05-28-2006, 08:49 AM
  4. get RGB values
    By lmo863 in forum C++ Programming
    Replies: 7
    Last Post: 03-12-2005, 05:50 AM
  5. Stopwatch program (need help!)
    By modnar in forum C Programming
    Replies: 9
    Last Post: 03-22-2004, 12:42 AM