[cairo] how to make existing color transparent

Pablo Romero romero619 at hotmail.com
Thu Feb 5 18:02:19 PST 2009


Is it possible to set the alpha transparency on an existing color within a surface, and cause that color & anything beneath it to have 0 alpha, completely transparent???
 
example:
I want to draw a purple rectangle on a surface, over existing image data.
Next, I want to make that rectangle completely transparent in the resulting png file (i.e., 'set any/all areas that are purple to 100% transparent on cairo_surface_t *surface'). I dont want any existing colors/graphics that were below the rectangle to show up.
 
I tried using "set_source_rgba" and setting the alpha to '0.0', but this doesnt cause the underlying colors/images to become transparent...
 
How can I achieve this effect? similar to gd's "gdImageColorTransparent" function...
Please help...
Thanks,
P.Romero

_________________________________________________________________
Windows Live™: E-mail. Chat. Share. Get more ways to connect. 
http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_AE_Faster_022009
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20090205/e76f42f6/attachment.htm 


More information about the cairo mailing list