Tag: 透明

Win32(GDI) – 设置静态控制的不透明度

我正在使用C – (没有MFC或GDI +) 🙂 我想要的是将我的子窗口的不透明度设置为100(我的子窗口是STATIC控件)。 我想知道这是否可能,如果是这样,有人请指出我正确的方向如何做到这一点。 这是我的设置: 我创建我的父窗口如下: HWND hWnd; WNDCLASS wndCls_s; wndCls_s.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; wndCls_s.lpfnWndProc = MainWndProc; wndCls_s.cbClsExtra = 0; wndCls_s.cbWndExtra = 0; wndCls_s.hInstance = hInstance; wndCls_s.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_BSN_64)); wndCls_s.hCursor = LoadCursor(NULL, IDC_ARROW); wndCls_s.hbrBackground = CreateSolidBrush(RGB(0, 0, 0)); wndCls_s.lpszMenuName = NULL; wndCls_s.lpszClassName = pszCName; if (RegisterClass(&wndCls_s) == 0) […]

如何在XLib中创建半透明白色窗口

我想在XLib中创建一个半透明的白色窗口,但窗口不是半透明的,它仍然是完全不透明的。 我使用compton合成器,系统中有透明窗口,所以问题在于代码: #include #include #include int main(int argc, char* argv[]) { Display* display = XOpenDisplay(NULL); XVisualInfo vinfo; XMatchVisualInfo(display, DefaultScreen(display), 32, TrueColor, &vinfo); XSetWindowAttributes attr; attr.colormap = XCreateColormap(display, DefaultRootWindow(display), vinfo.visual, AllocNone); attr.border_pixel = 0; attr.background_pixel = 0x80ffffff; Window win = XCreateWindow(display, DefaultRootWindow(display), 0, 0, 300, 200, 0, vinfo.depth, InputOutput, vinfo.visual, CWColormap | CWBorderPixel | CWBackPixel, &attr); […]

如何让Gtk +窗口背景透明?

我想让Gtk +窗口的背景透明,以便只有窗口中的窗口小部件可见。 我找到了一些教程: http://mikehearn.wordpress.com/2006/03/26/gtk-windows-with-alpha-channels/ http://macslow.thepimp.net/?p=26 但他们似乎都倾听“暴露”事件,然后委托开罗进行渲染。 这意味着不会渲染添加到窗口的其他窗口小部件(例如,我也尝试向窗口添加按钮)。 我看到GtkWidget上有一个方法modify-bg: http : //library.gnome.org/devel/gtk/stable/GtkWidget.html#gtk-widget-modify-bg 但是,GdkColor似乎不接受透明度参数: http : //library.gnome.org/devel/gdk/stable/gdk-Colormaps-and-Colors.html 我也尝试过GtkWindow.set_opacity方法,但这也设置了窗口内容的不透明度,这不是我想要的。 我很感激任何人都可以提供任何指导。