[cairo] Transparency

Jose Hevia jose.francisco.hevia at gmail.com
Sat Jul 14 03:10:04 PDT 2007


Hello,
I just want to confirm if those are bugs:
I want to clear a surface with cairo,so the screen displays a color
background with transparency, so I do:

  cairo_set_source_rgba (new->cr, 0,1,1,0.1);

  cairo_set_source_surface (new->cr,new->surface, 0, 0);
  cairo_set_operator (new->cr, CAIRO_OPERATOR_CLEAR);
  cairo_paint(new->cr);

where new->suface is a "cairo_surface_t" and new->cr "cairo_t". Then I
paste little images with CAIRO_OPERATOR_OVER.

BUG: I can't change clearing color. Is always(0,0,0,0). Is this a bug?

I can clear the surface manually,without cairo, then dispay with
CAIRO_OPERATOR_SOURCE,but:

ANOTHER BUG:Transparency seems a function of the screen luminosity
((R+G+B)/3), instead of alpha--->(255,255.255,0) is always opaque
white, no matter what is behind the window.

Black (0,0,0,255) is opaque through.

System Info: Ubuntu FF with beryl, cairo 1.4.2

Bye


More information about the cairo mailing list