What this code can do:
Draw lines on a
Incrementally draw a polygon on an image
Detect incomplete or tangled (edge crossed) "polygons"
Get a finished polygon description, as verticies or scan lines
Augment Object with beget method as per
For more detail, see the module API at the beginning of
, or view the source for this page (which uses it). This page contains an example of the rather picky business of connecting drawing functions to mouse events.
Download the module
Control-click to undo the last vertex
Show Scan Lines