Sceen Grabbing
Sceen Grabbing
- Subject: Sceen Grabbing
- From: Paul Querna <email@hidden>
- Date: Tue, 10 May 2005 14:40:09 -0700
Hello,
I am attempting to create a Screen shot of a section of the screen,
using PyObjc. The only examples I have seen, are using the
NSBitmapImageRep.initWithFocusedViewRect(). This seems to work for
creating an image of my winodw -- but my window is transparent, and
nothing bellow it is shown.
bitmap = NSBitmapImageRep.alloc().initWithFocusedViewRect_(rect)
img = bitmap.representationUsingType_properties_(NSPNGFileType, {})
img.writeToFile_atomically_("test.png", 1)
This will create a png that is just a transparent alpha layer, it
doesn't grab anything bellow it.
I ran nm on /usr/sbin/screencapture, and saw that is it calling a
function 'CGContextCopyDisplayCaptureContentsToRect', which seems to be
completely undocumented. It seems like I need to call something at the
CoreGraphics level to get the data off a frame buffer.
Is there any example code for taking a screen shot? (I am using Python,
but ObjectiveC would be fine too.)
Thanks,
-Paul Querna
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden