Screen snapshot

Hi,

I’ve been coding in Processing for a while and I’m trying OF for a change.

To begin with, I’d like to code a little app that grabs any part of the screen I tell it to and render it on the OF window. Looking at the reference page I found a screenGrab() function that grabs the OF window and saves it into a PNG file. I’d like to do just that but with the whole screen, not just the OF window. Is that possible?

Later on i’m planning to make it a video screen grabber (maybe ‘caster’ would be more appropiate), but I think I can manage that, if I ever get past this point.

And, in case you’re wondering, no, I never coded such a thing on Processing. Dunno if that’s possible either.

Any pointers will be very much appreciated.

Cheers

I’m really interested in this too, but it’s very platform specific. There isn’t a single way to do it that’s genuinely cross platform.

On Windows, there is some good info here: http://www.codeproject.com/KB/cpp/Screen-Capture--Win32-.aspx

I see. Thanks for the tip. Actually it makes quite a lot of sense that it’s platform specific, since we’ll be trying to reach a system feature such as video output. Hadn’t occured to me.

I’m just making a blind guess, but maybe the solution goes through managing the video card output, which makes us driver-dependant. Too much for my limited knowledge.

hi,

thanks to zach the is some ready to go “code” for the mac. have a look here:http://forum.openframeworks.cc/t/grabbing-from-the-screen-osx/2946/0

edit: by the way I tried that once in java and there it’s heavy processor intensive – at least with high capture dimensions, for example fullscreen took 50% (100% on one core) cpu of my macbook pro! … with c++, respective cocoa, it’s a lot faster!

Thank you soooo much! It might do the trick. I downloaded it but gives me 158 errors when I compile. I’m sure there’s something wrong with the paths. Will take a look at it later.

I didn’t find that thread when searching before i posted this. Need some glasses i guess…

Thank you soooo much! It might do the trick. I downloaded it but gives me 158 errors when I compile. I’m sure there’s something wrong with the paths. Will take a look at it later.

I didn’t find that thread when searching before i posted this. Need some glasses i guess…

hmm,

for me it works - I can upload you my version, but I’m not sure if that makes sense because the screenshooting part is basically the same as the one zach posted.

cheers