SCScreenshotManager.captureImage and display sleep

I am using SCScreenshotManager.captureImage to capture image of an app window. i have the sleep settings that sleeps the display but not the system. when the display sleeps taking screenshot using SCScreenshotManager.captureImage does not work. Is there a way i can take screenshot of window when the display sleeps?

Thanks

Thank you for the post. The question is indeed dependent on the specific application being used and whether the machine is in sleep mode. If the machine is in sleep mode, it means that the Mac Catalyst or macOS application is not running, and consequently, the code will not execute.

https://developer.apple.com/documentation/screencapturekit/scscreenshotmanager/captureimage(in:completionhandler:)

So, there is no direct way to capture a screenshot of a window using ScreenCaptureKit (SCScreenshotManager) while the display is asleep.

Albert
  Worldwide Developer Relations.

My situation is only the display sleeps the system is not sleeping the app is running it is a http server and i can access the pages served by the mac os app. but when the app tries to take screenshot when the display sleeps it is not working. this is my scenario.

@rbmanian75 So when the display sleeps do you think the catalyst app or macOS app are in the foreground or the background?

Look at the requirements of that API, do you think that works on HTTP server?

In your scenario and based on your description it is still impossible for SCScreenshotManager to capture a window.

Albert
  Worldwide Developer Relations.

SCScreenshotManager.captureImage and display sleep
 
 
Q