Getting CGContext for a window

Member
Posts: 86
Joined: 2005.01
Post: #1
I'm trying to get a CGContext for a window, so I can dump it to a PNG CGImage and take a screenshot/movie.

I can't seem to find any method that gets me a CGContextRef in Carbon other than the Printing Manager functions, and those seem inappropriate for my needs (I have to set up a printing session first). Does one exist? I can't seem to find it in the Quartz2D reference guide (only the Printing Manager functions are listed).

I know in Cocoa there's a message, graphicsContext, for it.

Is there a better way to take a screenshot/sequence of screenshots from a given WindowRef?

Newest game: Glow, a sci-fi RPG with lots of zombie bashing. Get it: OS X
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
http://developer.apple.com/documentation...lementID_4

Doesn't look very helpful, actually :|

I'd guess that this will be a very slow way to do what you want, anyway... not that I can think of a better one that doesn't snapshot the whole screen...
Quote this message in a reply
Member
Posts: 86
Joined: 2005.01
Post: #3
That'd probably explain why there are no decent screen-grabbing utilities for OS X that don't take just a window.

I guess I'll have to pony up for a copy of Snapz Pro. Sad

Newest game: Glow, a sci-fi RPG with lots of zombie bashing. Get it: OS X
Quote this message in a reply
Post Reply