在X根窗口上绘图 [英] Drawing on the X root window

查看:100
本文介绍了在X根窗口上绘图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够在Linux的根窗口上进行绘制. IE.制作OSD.

I'd like to be able to draw on the root window in Linux. I.e. make an OSD.

我正在使用Gnome.

I'm using Gnome.

代码示例或指向它们的链接.

Code samples or links to them would be appreciated.

推荐答案

可能,但是您不会在GNOME中看到任何内容. GNOME的文件管理器Nautilus在根X窗口的顶部打开自己的窗口以显示图标.由于根X窗口已被完全覆盖...因此在其上进行绘制是没有意义的.

It is possible, but you will not see anything in GNOME. Nautilus, GNOME's file manager, opens its own window on top of root X window to display icons. Because of that the root X window is fully covered... so there is no point in drawing on it.

如果要制作OSD,则应该使用 XOSD 之类的库,或者打开您的OSD拥有自己的X窗口并使其透明.实际上,XOSD的源代码应该是一个很好的例子.

If you want to make OSD, either you should use a library like XOSD, or open your own X window and make it translucent. In fact, XOSD's source code should be a good example of how to do this.

似乎整个库都在一个文件中实现: xosd.c .

Whole library seems to be implemented in one file: xosd.c.

这篇关于在X根窗口上绘图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆