I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2008-01-10 14:13:03-08 by craigc
Sampling pixel color on screen
Hi everyone,

  What is the best way to sample the color of a pixel on the screen? In other words, how close can I get to the following:

my ($r,$g,$b) = GetPixelOnScreen($ScreenX,$ScreenY)

where $ScreenX, and $ScreenY are screen coordinates instead of image file coordinates?

  If I have to take a screen shot first, save that to a file, then analyze the file, I'm willing to do that, it just seems like overkill. Is there an easier way? If there's not an easier way, what's the best way to get the screen image into a format that GD can parse?

Thanks very much.
  Craig
Direct Responses: Write a response