Tag: alpha

Alpha混合C中的2种RGBA颜色

可能重复: 如何快速进行alpha混合? alpha混合2种RGBA(整数)颜色的最快方法是什么? 作为注释,要混合的目标颜色始终是不透明的,只有第二种颜色可以具有不同的透明度。 我试图在C中找到最快的方法,考虑到混合的最终结果颜色必须最终没有透明度,完全不透明(alpha = 0xff)

如何在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); […]