Re: Taking screen shots
Re: Taking screen shots
- Subject: Re: Taking screen shots
- From: Kevin Meaney <email@hidden>
- Date: Wed, 18 Jun 2014 16:24:48 +0100
> Not really.
>
> Can you show some code?
>
dictArray = CGWindowListCopyWindowInfo(kCGWindowListOptionIncludingWindow,
(CGWindowID)[self._window windowNumber]);
if (dictArray && (CFArrayGetCount(dictArray) > 0))
windowDict = CFArrayGetValueAtIndex(dictArray, 0);
if (windowDict && (CFDictionaryGetCount(windowDict) > 0))
rectDict = CFDictionaryGetValue(windowDict, kCGWindowBounds);
if (rectDict)
{
if (CGRectMakeWithDictionaryRepresentation(rectDict, &winRect))
gotRect = YES;
}
if (dictArray)
CFRelease(dictArray);
NSRect screenRect;
if (gotRect)
{
// screenRect = [self._window contentRectForFrameRect:winRect];
screenRect = winRect;
screenRect.origin.y += winRect.size.height - self._height;
screenRect.size.height = self._height;
}
else
{
NSScreen *screen = self._window.screen;
CGFloat screenHeight = screen.frame.size.height;
NSRect windowRect = self._window.frame;
NSRect contentRect = [self._window contentRectForFrameRect:windowRect];
screenRect = CGRectMake(
contentRect.origin.x,
screenHeight - (contentRect.origin.y + contentRect.size.height),
contentRect.size.width,
contentRect.size.height);
}
MICGImage *newImage;
CGImageRef cgImage;
cgImage = CGWindowListCreateImage(screenRect,
kCGWindowListOptionIncludingWindow,
(CGWindowID)[self._window windowNumber],
kCGWindowImageBoundsIgnoreFraming);
> --Kyle Sluder
> _______________________________________________
>
> 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
_______________________________________________
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