Apologies, 

The e-mail with the code went out before I was finished editing.

The code shown is that taking the screen capture. But what is captured is not 
what I see in the window.

Kevin

On 18 Jun 2014, at 16:24, Kevin Meaney <k...@yvs.eu.com> wrote:

>> 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 (Cocoa-dev@lists.apple.com)
>> 
>> 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:
>> https://lists.apple.com/mailman/options/cocoa-dev/ktam%40yvs.eu.com
>> 
>> This email sent to k...@yvs.eu.com
> 
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/ktam%40yvs.eu.com
> 
> This email sent to k...@yvs.eu.com


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to