Re: Redirecting screencapture output
Re: Redirecting screencapture output
- Subject: Re: Redirecting screencapture output
- From: David Blanton <email@hidden>
- Date: Thu, 22 Jul 2004 08:50:02 -0600
There are good screen capture code samples that are real easy to add to an
existing app which give you the screen image as an NSBitMapRep. Fromther
flail away.
On 7/22/04 5:22 AM, "Yann Bizeul" <email@hidden> wrote:
>
As far as I know, screencapture does not provide a way to pipe its
>
result to stdout.
>
An ugly workaround would be to create a fifo in /tmp/ and save the
>
result to this fifo. You would be able to read the fifo to get the file
>
back. Like this, you won't have file operation overhead.
>
>
Personaly, I would write the screen to /tmp and read it back with
>
NSImage, If I don not find a way to handle the screen capture all by
>
myself.
>
>
Le 21 juil. 04, ` 15:29, Lorenzo a icrit :
>
>
> Hi,
>
> as you know the unix command "screencapture" saves the main screen
>
> content
>
> to a PDF file or to the clipboard. Instead I would like to don't save
>
> any
>
> file (it's slow), don't occupy the clipboard, but I would like to get
>
> that
>
> output in a NSData or NSImage variable in my application. Is any way
>
> to do
>
> that? Piping the command? If so, I don't know the sintax.
>
> Can someone help me?
>
>
>
> Actually I call
>
> NSArray *args;
>
> args = [NSArray arrayWithObjects:@"-x", @"-m", @"filePath", nil];
>
>
>
> I tried even to add
>
> NSPipe *myPipe = [NSPipe pipe];
>
> [task setStandardOutput:myPipe];
>
>
>
> but the length of
>
> NSData *dataOut = [[[task standardOutput] fileHandleForReading]
>
> availableData];
>
> is zero. And the file has been saved anyway.
>
>
>
> I tried also the following unsuccessfully. I don't know the syntax.
>
> args = [NSArray arrayWithObjects:@"-x", @"-m", @"|", nil];
>
> What should I write after the pipe "|" ?
>
>
>
> Any code would be welcome. Thanks.
>
>
>
>
>
> Best Regards
>
> --
>
> Lorenzo
>
> email: email@hidden
>
> _______________________________________________
>
> 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.
>
>
>
>
>
>
>
--
>
Yann Bizeul - yann at tynsoe.org
>
http://projects.tynsoe.org/
>
_______________________________________________
>
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.
_______________________________________________
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.