[cairo] Problems with transparent background
Lawrence D'Oliveiro
ldo at geek-central.gen.nz
Wed Feb 22 21:03:51 UTC 2017
On Wed, 22 Feb 2017 19:30:13 +0100, Martin Fischer wrote:
> gboolean expose(GtkWidget *widget, GdkEventExpose *event, gpointer
> data) {
> cairo_t *cr = gdk_cairo_create(widget->window);
>
> if( glob.image == NULL )
> CreateBackground( cairo_get_target (cr));
>
> cairo_rectangle(cr, event->area.x, event->area.y,
> event->area.width, event->area.height);
> cairo_clip(cr);
> cairo_set_source_surface(cr, glob.image, 0, 0);
Maybe add
cairo_set_operator( cr, CAIRO_OPERATOR_SOURCE );
at some point before the following paint call?
> cairo_paint(cr);
More information about the cairo
mailing list