How to take a screenshot in an area that ignores your application window on Mac OS X

I am trying to make something like a pixie application on Mac OS X. I am doing this by taking a screenshot around the mouse and putting a screenshot in the image.

image = CGDisplayCreateImageForRect(displays[i], CGRectMake(x_start, y_start, width, height)); 

the problem is that it also captures the window of my application. How can I take a screenshot that treats my application window as transparent and takes only what is outside my application window.

Thanks in advance.

+4
source share
2 answers

You can use CGWindowListCreateImage and set your own sharingType window to NSWindowSharingNone (so that it is skipped in the screenshot). I'm not sure if this method will be fast enough for your purposes.

+3
source

You can easily take a screenshot of any unwanted or wanted area on mac with this shortcut key. These keys will really help you in any picture capture on Mac.

Just press Shift + Command + 4 and then take the available crosshairs anywhere you want to take a screenshot.

-2
source

All Articles