Fwd: Writing optimized screeshot utility.
Fwd: Writing optimized screeshot utility.
- Subject: Fwd: Writing optimized screeshot utility.
- From: "Teemu Keinonen" <email@hidden>
- Date: Wed, 21 Nov 2007 16:15:17 +0200
Ok, figured it out myself. I get printouts now:
[NSApplication sharedApplication];
CGRegisterScreenRefreshCallback (MyScreenRefreshCallback, NULL);
[NSApp run];
----
Thank you for the information. However when i try the following:
void MyScreenRefreshCallback ( CGRectCount count, const CGRect * rectArray,
void * userParameter) {
int i;
fprintf(stderr, "%i rects\n", count);
for (i=0; i < count; i++) {
fprintf(stdout, "%i %i %i %i\n", rectArray[i].origin.x,
rectArray[i].origin.y, rectArray[i].size.width, rectArray[i].size.height);
}
}
int main(int argc, char **argv)
{
CGRegisterScreenRefreshCallback (MyScreenRefreshCallback, NULL);
CFAbsoluteTime now = CFAbsoluteTimeGetCurrent ();
while ( CFAbsoluteTimeGetCurrent ()-now < 15 ) {
sleep(1);
}
CGUnregisterScreenRefreshCallback (MyScreenRefreshCallback, NULL);
return 0;
}
I get no printout whatsoever although screen does change. Is there some
initialization that's needed before this works?
Thanks,
Teemu Keinonen
On Nov 20, 2007 5:14 PM, Shawn Erickson <email@hidden> wrote:
>
> On Nov 20, 2007, at 4:02 AM, Teemu Keinonen wrote:
>
> > Hi all,
> >
> > I want to write optimized screenshot utility to make videos from
> > screeen and
> > therefore i want to know what parts of the screen have changed since
> > last
> > snapshot. I can think of two alternatives:
> >
> > 1) Is it possible to get dirty region information from window
> > manager via a
> > callback or such?
>
> Yes.
>
> <http://developer.apple.com/documentation/GraphicsImaging/Reference/Quartz_Services_Ref/Reference/reference.html#//apple_ref/doc/uid/TP30001070-CH1g-F16970
> >
>
> -Shawn
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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