grab screens from another application window in OS X

This is very likely impossible, but I would like to show what is going on in a window from another application in my OF app. Specifically, I want to take a Photoshop window and map it to a texture. I suspect there might be a way to do this in OS X, but I don’t even know where to begin looking.

Any suggestions would be much appreciated.

You can most certainly do it:

http://www.objective-cocoa.org/fenetres-…-ex-en.html

But I’m not quite sure how (yet), I’d poke around the Cocoa API, it’s bound to be there somewhere.

In relation to that, sometimes when you create textures on the Mac and you don’t give it data to initialise with (you reserve a chunck of memory to draw on basically) you get whatever was there before in graphics memory. Usually it’s chunks of windows you’ve had open and the like. Very glitch art.

I’ve been meaning to make an app that lets you explore whatever you mgiht have lying around in memory on the graphics card.

Haven’t seen it happen on my PC (using the same code), strange, must be a driver thing.

/A

hi –

just saw this when googling, could be helpful

  
  
PixMap pixMap;  
GetQDGlobalsScreenBits((BitMap*)&pixMap);   
  

spotted here:

http://www.thescripts.com/forum/thread221200.html

hope that leads to fruitful googling :slight_smile:

  • z

and here:

http://developer.apple.com/samplecode/S-…-ting2.html

and the more modern:

http://developer.apple.com/samplecode/S-…-index.html

(the second is not c++ but still some googleable code in there to check out)

-z

ps hahahkid, this is a cool project in the territory of seeing your memory:

http://www.turbulence.org/Works/arcangel/

That’s excellent, thanks!

Not at all what I would have expected random memory to look like to quicktime, it’ll have to do with the method he used to make quicktime interpret it I suppose, must read up on this a little bit, very interesting!

/A

Any code for solving this yet? Would be very interesting!

I don’t know if this helps but you can do a screen grab of your whole display and save it as a jpg in your data folder with this:

Note: make the word syst3m bellow lowercase. and remove change the 3 to and e
Stupid php :smiley:

  
string command = "screencapture -C -tjpeg " + ofToDataPath("mycapture.jpg");  
SYST3M(command.c_str());  

More info for other screengrab options here:
http://www.tuaw.com/2007/05/17/terminal-…-ur-screen/

Theo

not sure how it would integrate with openframeworks… but Vade (from the QC / VDMX world) is working on a Quartz Composer plugin which does this (grabbing the buffer from a opengl contexts), more info on this thread:
http://www.vidvox.com/phpBB2/viewtopic.-…-2233#12233

As QTZ files can be wrapped in standard .mov, perhaps the wrapped quicktime movie could be opened in an of app… but you will not have the interactivity for sure…

its early days yet… but exciting nevertheless :stuck_out_tongue: