Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Alpha value of pixels in Xlib window

I am going through (Change Xlib window background color with C++) & know to set the background color of XWindow.

But how can I set the Alpha value of that Xwindow. I tried several things, but when I do read from XWindow, each pixel has Alpha as 0xff.

Is there any way I can set this alpha as 0x00. Please provide some sample code.

like image 405
user1409528 Avatar asked Oct 26 '25 23:10

user1409528


1 Answers

Setting the alpha channel will only work for visuals with a depth of 32 bits. Use XMatchVisualInfo to create 32 bit visuals. That will only work though if your graphics hardware supports it.

Check out this answer where I have posted sample code that generates a completely transparent window.

like image 86
kassiopeia Avatar answered Oct 29 '25 09:10

kassiopeia