MacOS – How to take a screenshot of the area that ignores the application window on Mac OS X

I want to make something like pixie app on Mac OS X. I do this by taking a screenshot of the area around the mouse and placing the screenshot in the image view.

< /p>

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

The problem is that it still I captured the window of my application. How to take a screenshot that treats my application window as transparent and only displays it behind my application window

Thanks in advance.

div>

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

I want to make something like pixie app on Mac OS X. I do this by photographing the area around the mouse Take a screenshot and place the screenshot in the image view.

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 only displays it behind my application window

p>

Thanks in advance.

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

Leave a Comment

Your email address will not be published.