i want the user to be able to click somewhere on the canvas and the polygon will appear on it
<DIV id="canvasarea" class="rounded">
<CANVAS id="canvas" width="800px" height="800px"></CANVAS>
</DIV>
i want the user to be able to click somewhere on the canvas and the polygon will appear on it
<DIV id="canvasarea" class="rounded">
<CANVAS id="canvas" width="800px" height="800px"></CANVAS>
</DIV>
Use a javascript library, I'd try processingjs first - keep in mind IE has to be tricked into supporting canvas.
I didn't see a sample that matched your request exactly but these two should give you a good starting point
http://processingjs.org/learning/basic/shapeprimitives
same-domain-as-above/learning/topic/continuouslines
there is also a great primer on canvas here - google "dive into html5 canvas"