Re: making a screenshot
Re: making a screenshot
- Subject: Re: making a screenshot
- From: Brant Sears <email@hidden>
- Date: Tue, 20 Jan 2004 18:51:57 -0800
There are several ways. One person suggested a call to a command line app.
If you are running under Jaguar, you could also invoke an AppleScript to
take a screen shot.
Another method is to use the core graphics routine: CGDisplayBaseAddress()
to get the address of the frame buffer. Inside of CGDirectDisplay.h there
are several calls that you can use to get things like the display size, the
bit depth, etc. that you will need in order to interpret the framebuffer.
There is also a way to setup an OpenGL full screen context and call
glReadPixels() which can also get at the screen data.
Or, if you are really old fashioned, you can the QuickDraw interface (from
Carbon), you can get at the screen data by looking at the gdpMap field in a
GDevice structure which is returned by calls like GetMainDevice(). You can
do a CopyBits from this into some buffer that you own.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.