How to dim os x desktop using Cocoa/Core Animation

跟風遠走 提交于 2020-01-10 20:01:14

问题


Is there a way to control the brightness of the OS X desktop programmatically using Cocoa or Core Animation?


回答1:


In case you were actually interested in doing a fade-out or fade-in of the whole screen, here is a link describing how to do that.

The linked document contains examples for how to fade all displays (or a single display) to black (you can change the color), capture the display (where you can display what you'd like), and then fade back. This uses CGAcquireDisplayFadeReservation() mentioned in the comment to my other answer.

Is this more like what you were looking for?




回答2:


Create a semi-transparent full-screen view behind your main window.



来源:https://stackoverflow.com/questions/818829/how-to-dim-os-x-desktop-using-cocoa-core-animation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!