[cairo] understanding radial pattern radius

cairo at zevv.nl cairo at zevv.nl
Mon Aug 7 00:57:07 PDT 2006


Hello All,

I'm having some problems understanding the parameters of the
cairo_pattern_create_radial() function. According to the documentation,
the arguments are :

    cx0 : 	 x coordinate for the center of the start circle
    cy0 : 	y coordinate for the center of the start circle
    radius0 : 	radius of the start cirle
    cx1 : 	x coordinate for the center of the end circle
    cy1 : 	y coordinate for the center of the end circle
    radius1 : 	radius of the end cirle

I am trying to create a pattern that goes from white to black; the
center of the pattern up to radius should be white, then from radius 100
to 130 go from white to black, and everything outside radius 130 is
black. As I understand, I should call :

cairo_pattern_create_radial(cr, cx, cy, 100, cx, cy, 130)

However, this does not give me the expected result. Instead of the image
I described above, I get the following:

	http://zevv.nl/div/a.jpg

The center of the pattern is OK, all white up to r=100, but after that,
the gradient is not 'steep' enough: instead of being black at r=130, it
takes much longer for the gradient to go black.

I've been playing with this function a lot, but I can't get it to work
the way I want. Any ideas on this issue ? ciaro verion is 1.2.0

Thank you very much,

Ico

-- 
:wq
^X^Cy^K^X^C^C^C^C


More information about the cairo mailing list