Find the answer to your Linux question:
Results 1 to 4 of 4
Hi I would like to get the pixel color from screen at (320,240) and if the color = 0xFFFFFFFF , i would like to execute a command. thanks for help...
  1. #1
    Just Joined!
    Join Date
    Nov 2010
    Posts
    1

    Get Pixel Color from screen in bash script

    Hi

    I would like to get the pixel color from screen at (320,240) and if the color = 0xFFFFFFFF , i would like to execute a command.

    thanks for help

  2. #2
    Linux Newbie
    Join Date
    Mar 2010
    Posts
    121
    Quote Originally Posted by unnnamed View Post
    I would like to get the pixel color from screen at (320,240) and if the color = 0xFFFFFFFF , i would like to execute a command.
    I'm not sure if that's even possible, but why on earth would you want to do that?

  3. #3
    Just Joined!
    Join Date
    Nov 2006
    Posts
    21

    Take a screen shot, then open it with GIMP...

    use the colour select tool and click on the pixel you want, then click on the foreground/background colour tool to get details of the new foreground colour. It's in html format, so you'll need to convert to whatever language you are using.

  4. #4
    Just Joined!
    Join Date
    Feb 2007
    Posts
    1

    Use external custom program

    Best thing I could think of is write an external C/C++program that takes coordinates as an arguments and prints pixel color on stdout.

    This C/C++ program may require to use XLib or whatever window manager OS is using.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...