[cairo] some confusion about cairo_surface_t

Simon Sapin simon.sapin at exyr.org
Wed Jan 23 04:19:37 PST 2013


Le 23/01/2013 12:17, %&坏小孩&% a écrit :
> could'u please provide me a smaple?
> thanks very much~~

Don’t forget to keep the mailing list in CC, like I did here.


 From your first message (simplified)

> cairo_surface_t * cairo_surface_main =
>     cairo_image_surface_create_for_data(…)
> cairo_t * cairo_image_main = cairo_create (cairo_surface_main);
>
> cairo_surface_t * cairo_surface_sub =
>     cairo_image_surface_create_for_data(…)
>
> I'd like to buffer something in "cairo_surface_sub",
> and then use "cairo_surface_sub" as the source of "cairo_image_main".


cairo_set_source_surface(cairo_image_main, cairo_surface_sub, 0 0);

Then probably something like this, to actually paint the source:

cairo_paint(cairo_image_main);

-- 
Simon Sapin


More information about the cairo mailing list