[cairo] Drawing a multicolor spline

Andrea Canciani ranma42 at gmail.com
Fri Apr 27 01:30:43 PDT 2012

On Fri, Apr 27, 2012 at 9:45 AM, Andrea Canciani <ranma42 at gmail.com> wrote:
> On Wed, Apr 25, 2012 at 8:35 PM, Davide Calaminici <amiblit at gmail.com> wrote:
>> Hello,
>> i'm trying to learn cairo graphics doing some test here and there.
>> I want to draw a spline or bezier, simulating a Windows screen saver like
>> Mistify or Ribbons.
>> Anyone have a simple sample code in c for this?

Some sample code which might be somewhat similar to Mystify is attached.


> Some sample code on how to draw Bezier curves can be found here:
> http://cairographics.org/samples/curve_to/
> If you want the spline to be multicolor, you will need to draw it with
> a source that is not solid black, but some kind of pattern.
> A different approach might be that of painting a gradient mesh pattern
> (possibly without even using a mask).
> Sample code can be found here:
> http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-create-mesh
> Andrea
>> Thank you very much
>> --
>> cairo mailing list
>> cairo at cairographics.org
>> http://lists.cairographics.org/mailman/listinfo/cairo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mystify.c
Type: text/x-csrc
Size: 2473 bytes
Desc: not available
URL: <http://lists.cairographics.org/archives/cairo/attachments/20120427/7f21a1ea/attachment.c>

More information about the cairo mailing list