[cairo] ImageSurface from a Pattern

Donn donn.ingle at gmail.com
Wed Dec 10 06:28:08 PST 2014

I'm doing some push_group, draw, pop_group() stuff. Once I have a ref to 
the pattern, I'd like to know its width and height.

(I'm really hoping to find the size in bytes - just in case I'm creating 
a cache-beast gone mad! *)

The docs are leading me in dizzy circles. I seem to be able to get a 
generic Surface from the pattern, but not an ImageSurface on which I can 
use cairo_image_surface_get_width()  etc.

Can you help? Python, Vala or C code is good.


* On this subject: If I create a clip and draw within that, followed by 
a pop_group, will the pattern's image surface be size (area) of the clip?
  Is a clip even needed, i.e. is cairo clever enough to give me a 
pattern of the appropriate size for the drawing just drawn?

More information about the cairo mailing list