[cairo] Filling everything but the shape
Gerdus van Zyl
gerdusvanzyl at gmail.com
Mon May 26 08:29:55 PDT 2008
Could you please post the relevent code you are using? The "fill a
transparent arc on the mask" part sounds incorrect, you need to clear it
example python code:
canvas = cairo.ImageSurface(cairo.FORMAT_ARGB32,320,240)
ctx = cairo.Context(canvas)
#fill with blue
maskSurface = cairo.ImageSurface(cairo.FORMAT_ARGB32,320,240)
ctxM = cairo.Context(maskSurface)
#knock out rectangle
maskPattern = cairo.SurfacePattern(maskSurface)
debug = False
On Mon, May 26, 2008 at 12:36 PM, Ricky Wood <rickywoodster at yahoo.co.uk>
> I'm new to cairo and probably missing some obvious concept, please can
> someone enlighten me with this problem:
> Basically, I have a surface with some shapes already drawn onto it. I now
> want to paint every part of the surface a single colour except a circle,
> i.e. leave the contents of the surface, where the circle lies, undisturbed.
> The approach I took was:
> - create a mask
> - paint the mask totally opaque
> - fill a transparent arc on the mask
> - set the colour on the source
> - cairo_mask
> I thought the source colour would be transferred to the destination,
> leaving the circle masked.
> Where have I gone wrong, or is there a better approach?
> Sent from Yahoo! Mail<http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=52418/*http://uk.docs.yahoo.com/nowyoucan.html>.
> A Smarter Email.
> cairo mailing list
> cairo at cairographics.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cairo