Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

SeMig

macrumors newbie
Original poster
Dec 7, 2010
2
0
Hi!

I'm writing an application for automating certain tasks.
I'm using the ApplicationServices framework for moving the mouse and so on.

I need to know how to get the color of a specific screen pixel.
And what would be the faster way if i have to scan through multiple screen pixels? Using the above several times or is there a better way? (Maybe taking a screenshot?)

I'm writing in C++.
 
A basic way (not necessarily fastest) is to use the CGWindow API to grab an image of the screen and then you can extract what you need from it.

The other method is to use OpenGL's glReadPixel() function.
 
Somehow i think the CGWindow API is the fastest. Anyway i'll try it out. Thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.