[cairo] Drawing to multiple surfaces, "cairo_recorder", zoom (was: Some newbie question)

Carl Worth cworth at cworth.org
Fri Dec 14 14:13:30 PST 2007


On Fri, 14 Dec 2007 22:47:40 +0100, "Tuom Larsen" wrote:
> Hello. Yesterday's answers cleared up a lot but they provoked some more.
> Please:

No problem, that's what we're here for. :-)

> - Say an application draws to a window and optionally, if a user would like
> to, it exports the drawing to PDF. How?

First of all, an application, (at least one targeting X or GTK+), must
be prepared to redraw its contents, (or any portion of its contents),
at any time. So an application has to have code for that already.

> If I understood Carl's
> recommendation correctly -- to use "data structures [which] know how to
> 'draw themselves' given a cairo context -- I probably could write some dummy
> drawing functions (lineto, circle, stroke, ...) which would just record [1]
> the drawing operations (and serialize to disk, e.g. in a text file). Later,
> I could parse that file and execute the real drawing function of a given
> surface. Does it make sense to you?

No, that's not what I was describing at all. I'm just talking about
using the same code that made the stuff appear on the window in the
first place. Call that same code again with a cairo_t* targeting a PDF
surface instead of the cairo_t* targeting a surface for the window,
and you should be done.

Am I making sense yet?

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20071214/0c204022/attachment.pgp 


More information about the cairo mailing list