Cocoa: take screenshot of desktop wallpaper (without icons and windows)

后端 未结 3 1105
北荒
北荒 2020-12-17 05:13

Is is possible to capture the Mac OS X desktop without desktop items and any windows that may be open (i.e. just the wallpaper)?

I\'ve experimented with CGWind

3条回答
  •  暖寄归人
    2020-12-17 05:38

    I know this is a super old question, and Tony Arnold's question is right, and what I used to build my own "grab the desktop" code.

    I have some example code that shows how to do all these things (it's a wonderful thing walking in parts of Cocoa that are barely documented... )

    I've put that sample code up in a bitbucket repository. Specifically the code sample to take a picture. (There's more interesting Cocoa code in my learning Cocoa repository, where that sample code is from )

提交回复
热议问题