capture
is a CGImageRef
returned from a call to CGWindowListCreateImage()
. When I try to turn it into an NSImage
directly it mysteriously doubles in size. If I manually create a an NSBitmapImageRep
from capture
and then add it to an empty NSImage
everything works ok.
My hardware setup is a retina MBP + non-retina external display. The capture is taking place on the non-retina screen.
NSLog(@"capture image size: %d %d", CGImageGetWidth(capture), CGImageGetHeight(capture));
NSLog(@"logical image size: %f %f", viewRect.size.width, viewRect.size.height);
NSBitmapImageRep *debugRep;
NSImage *image;