Skip to content


Subversion checkout URL

You can clone with
Download ZIP


rename ofImage.grabScreen #1347

benben opened this Issue · 3 comments

2 participants


First: Is this method supposed to be in the public API of OF? Becaue it is missing in the reference on the website.

I think we should discuss the naming of this function. OF has methods like ofGetHeight() for getting the height of the app and ofGetScreenHeight() for getting the height of the screen. Instead ofImage_<PixelType>::grabScreen[1] does not grab the screen. I tested this on arch/ubuntu/win7 and it only grabs the app (everything else is black). Maybe it should be renamed to only ofImage_<PixelType>::grab. What do you think?



i think the reason it's a bit weird is that it's returning an image. everything else (ofGet*) returns some primitive data type, or maybe a string. but returning an image can have a heavy overhead cost.

the "screen" name is definitely misleading though. OF has ofGetWidth() and ofGetScreenWidth() which distinguish between the window and the screen. so we should rename this grabWindow and there should be another method called grabScreen that does what you want. here's some code for doing the global ("screen") stuff on osx: it would be cool to turn this into an addon and start ifdef'ing out sections for other platforms.


Sounds good. I will research this for Linux. Any help on this topic is appreciated, especially when we also want to implement this for Windows.

What I'm probably not getting right is your addon proposal? Would be nice if you could explain it a bit more, because I think it would be cool that a someone can use this code:

ofImage foo;
ofImage bar;
foo.grabWindow(0,0,ofGetWidth(), ofGetHeight());
bar.grabScreen(0,0,ofGetScreenWidth(), ofGetScreenHeight());

Or do I miss something here?


no, that would definitely be awesome to have in the core. but we need a complete implementation before it can go in the core, so i was thinking it could start as an addon.

@kylemcdonald kylemcdonald modified the milestone: 0.10.0, 0.10.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.