Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically grab screenshots in OSX

I am going to port some screenshot grabbing code (C++) for linux to osx. The current solution run graphical applications in xvfb and then use xlib to grab screenshots from the display. (That will also support if we are running without xvfb).

So as I understood osx is moving away from X11 so my question is what to use besides xlib to implement it now ? I have found Quartz Display Services. Is that what makes sense to use now ? Will that work with xvfb ?

like image 501
Zitrax Avatar asked Feb 28 '12 13:02

Zitrax


1 Answers

Yes, you will be able to call functions like CGDisplayCreateImage (documentation linked for you) by linking the Application Services framework to your C++ tool.

like image 124
Michael Dautermann Avatar answered Oct 19 '22 14:10

Michael Dautermann