HTML5 Polygonic Selection onmousemove
I need functionality like Photoshop polygon selection tool in HTML 5. I tried using HTML5 Path properties and I can draw lin开发者_C百科e on canvas but can't have logic to make that line join and make polygon selection.
You can handle clicks on the canvas and put the click coordinates in an array variable.
You can keep adding the points to path array until the path is complete. A path is complete when the user clicks on the first point after create 3 or more points.
You can use this application to draw your polygon and export it to give you the correct HTML and Javascript canvas statements to produce the polygon on a web page
canvimation
精彩评论