[Image-SIG] bezier curve

Coen van der Kamp coen at reservoir.nl
Fri Nov 17 17:41:20 CET 2006


I  tried to draw a bezier curve. The code underneath generates a 
triangle and not the desired curved line... Am I missing something?!

Coen.

import Image, ImageDraw, ImagePath
import aggdraw

im = Image.new('RGB', (100, 100), 'white')
draw = aggdraw.Draw(im)
pen = aggdraw.Pen('black', width=5, opacity=255)

mypath = aggdraw.Path()
#Adds a bezier curve segment to the path
mypath.rcurveto(10, 10, 90, 10, 90, 90)

xy = (0,0)
draw.path(xy, mypath, pen)
draw.flush()

im.save ('myfile.png', 'png')





More information about the Image-SIG mailing list