Re: How to capture my desktop?
Re: How to capture my desktop?
- Subject: Re: How to capture my desktop?
- From: Nicko van Someren <email@hidden>
- Date: Mon, 26 Feb 2007 16:07:18 +0000
On 26 Feb 2007, at 15:13, Michael Watson wrote:
You can use NSTask to invoke /usr/sbin/screencapture, which can
dump the screen to disk. Then go nuts with the resulting image.
On 26 Feb, 2007, at 16:15, Henry Joseph W wrote:
Hi All.
My purpose is very simple:I want to capture my desktop to generate
an image, then do some stuff to it.
In fact there is no need to send it to a file; you can send it to the
clipboard:
NSArray *args = [NSArray arrayWithObjects: @"screencapture", @"-
Sct", @"tiff", nil];
[[NSTask launchedTaskWithLaunchPath: @"/usr/sbin/screencapture"
arguments: args] waitUntilExit];
NSImage *i = [[[NSImage alloc] initWithPasteboard: [NSPasteboard
generalPasteboard]] autorelease];
Cheers,
Nicko
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden