[Mono-winforms-list] Transparent Control on X11?

Ivan N. Zlatev contact at i-nz.net
Mon Jul 23 09:43:25 EDT 2007


On 7/23/07, Rafael Teixeira <monoman at gmail.com> wrote:
> I would look at some other MWF control, to see how it is doing things
> about transparency, as I think some of them have support for it.
>

I grepped through the MWF code for transparency and stumbled upon
SetWindowTransparency in X11Hwnd.cs. But this seems to ignore the
Color key parameter [1] and makes the whole window (of the control)
transparent (I might be wrong?), which means that whatever I draw in
the foreground will be transparent as well. I "just" want a
transparent background.

[1]
		private void SetWindowTransparency (IntPtr handle, double
transparency, Color key)
		{
			IntPtr	x11_opacity;

			opacity = (uint)(0xffffffff * transparency);
			x11_opacity = (IntPtr)((int)opacity);

			IntPtr w = WholeWindow;
			if (reparented)
				w = display.XGetParent (WholeWindow);
			Xlib.XChangeProperty (display.Handle, w,
					      display.Atoms._NET_WM_WINDOW_OPACITY, display.Atoms.XA_CARDINAL, 32,
					      PropertyMode.Replace, ref x11_opacity, 1);
		}

-- 
Ivan N. Zlatev

Web: http://www.i-nZ.net
"It's all some kind of whacked out conspiracy."


More information about the Mono-winforms-list mailing list