Grab full HD images from MacBook screen

Hi everybody,
I have run into this problem: I want to save an image for every frame with the sizes of the GL window (1980*1020), in order to compose a fullHD video from images sequence.
This is what I’m using:

storeImage.grabScreen(0, 0, ofGetWindowWidth(), ofGetWindowHeight());

stringstream s;
string line = "screen";
string line2 = ".png";

s << line << imageNumber << line2;
string result = s.str();

storeImage.saveImage(result);

The problem is that grabScreen(…) only grabs at max the size of my computer screen (which is 1440*900). What should I use in order to bypass the screen size and grab directly the openGL window?

Thank you very much for any answer

You could render to an ofFbo object, and then use ofFbo::readToPixels.

That DEFINITELY solved my problem. Thank you!

1 Like