[cairo] How to resize the cairo surface ?

Kalle Vahlman kalle.vahlman at gmail.com
Tue Jan 29 04:48:32 PST 2008


2008/1/29, anurag swarnkar <anu_swar10 at yahoo.co.in>:
> >Only through creating a bigger surface and transferring the data with
> >'cairo_set_source_surface() ; cairo_paint()'.
> What i am concerned here is what are the APIs for getting the data and then
> setting it as a source.I tried with these APIs but i dont know whether this
> is correct or not.
>
>     cairo_pattern_t* cairoPattern =
> cairo_pattern_create_for_surface(mData->mSurface);
>     cairo_set_source(ctx, cairoPattern);
>     cairo_paint();
>
> Note: ctx is attached to another cairo surface.. To which i want to draw the
> original contents
> Is this correct or not?

Yes, the context is always for the surface you are drawing to, in this
case for the resized surface.

-- 
Kalle Vahlman, zuh at iki.fi
Powered by http://movial.fi
Interesting stuff at http://syslog.movial.fi


More information about the cairo mailing list