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

Tuom Larsen tuom.larsen at gmail.com
Fri Dec 14 15:05:53 PST 2007


On Dec 14, 2007 11:13 PM, Carl Worth <cworth at cworth.org> wrote:

> 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.


But the drawing would be a raster image embeded in PDF, no? Well unless I
switch to a vector surface target, as you suggest bellow?


>
>
> > 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?


Yes, I see, thanks. But consider this:
- The drawing is the result of some heavy computation - now it would have to
run twice.
- Or even worse, the result of some stochastic processes.
- How to pass the targeting surface through network or pipe? (Simple, you
[I] don't. You [I] send the drawing source code.)
Please, I certainly don't want to exaggerate.


>
>
> -Carl
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20071215/ca73ec60/attachment.htm 


More information about the cairo mailing list