How does Rainlendar achieve transparency with wxWidgets

懵懂的女人 提交于 2020-01-01 06:57:06

问题


Rainlendar is a fantastic cross platform calendar program that is written with wxWidgets. How does it achieve the transparency effect? Does anyone have any example code which demonstrates the transparency effect?


回答1:


My guess is that they could be using a wxScreenDC to draw directly to the screen (while preserving the background contents). Unlike receiving paint events or erase events, you create a wxScreenDC on the stack at your choosing, which means that you need to refresh yourself (most likely via a timer of some sort). If you don't, background applications will eventually repaint themselves over your wxScreenDC contents.

Here's the API listing

EDIT: Just to clarify, usage (besides the need to call StartDrawingOnTop and EndDrawingOnTop) is identical to any other wxDC.




回答2:


wxTopLevelWindow::SetTransparent() method may be what you need.



来源:https://stackoverflow.com/questions/745797/how-does-rainlendar-achieve-transparency-with-wxwidgets

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