[cairo] image surface and zdepth or composite
a.g.nienhuis at gmail.com
Sun Aug 22 12:33:54 PDT 2010
bb = draw_shapes_and_return_bounding_box()
g = pop_group()
On Sun, Aug 22, 2010 at 7:53 PM, Prashant Saxena <animator333 at yahoo.com>wrote:
> I am drawing various shapes (rectangles, disk, ellipse etc) on an image
> Number of shapes and their positions is calculating
> at run time. Once all the shapes are drawn, I am calculating the bounding
> box of
> all the shapes and then drawing a rounded rectangle whose size is equal to
> bounding box.
> This rounded rectangle is drawing in the end hence it over writes the shape
> data. To solve this problem first I am calculating the bounding box of
> shapes to
> be drawn, then drawing the rounded rectangle first and then rest of the
> Here pre-calculation is taking a bit extra time.
> Do we have something like z-depth that can be set before drawing? For
> you set depth to 1 draw all the shapes, while drawing bbox will be
> then you set depth to '0' and draw the rounded rectangle. It'll be drawn in
> back because it's depth is '0'.
> If z-depth is not available then another solution that might work is:
> 1. draw all the shapes and calculate bbox
> 2. draw rounded rectangle based on bbox on another image surface
> 3. composite shape surface on top of rounded rectangle surface
> I know 1 & 2 but I don't know if 3 is possible.
> Is there any other way to solve the above problem?
> cairo mailing list
> cairo at cairographics.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cairo