【发布时间】:2016-04-22 06:25:02
【问题描述】:
现在我已经有了想要正确绘制它们的图标。 目前我正在使用 Cairo 在窗口上绘制这些图像。 我有一个掩码和作为像素图的图标。
cairo_surface_t *image;
cairo_surface_t *imask;
cairo_surface_t *surface;
cairo_t *csurface;
surface = cairo_xlib_surface_create(display, d, DefaultVisual(display, screen), 400, 400);
csurface = cairo_create(surface);
Pixmap icon;
Pixmap mask;
//XWM Stuff ...
if(icon != 0)
{
get_pixmap_geometry(display, icon, &width, &height, &depth);
image = cairo_xlib_surface_create(display, icon, DefaultVisual(display, screen), width, height);
cairo_set_source_surface(csurface, image, 0, 0);
//How do I apply the mask?
//I tried cairo_set_operator(csurface, CAIRO_OPERATOR_SOURCE);
cairo_paint(csurface);
}
但图标没有任何透明胶片。我在互联网上没有找到用 cairo 解决这个问题的例子。只有一种复杂的方法,但它的记录非常糟糕,根本对我没有帮助。 有人有链接或示例说明如何使用透明胶片恢复原始图标吗? 提前谢谢你。
【问题讨论】: