Sunday, May 12, 2024
 Popular · Latest · Hot · Upcoming
93
rated 0 times [  97] [ 4]  / answers: 1 / hits: 30690  / 14 Years ago, wed, march 24, 2010, 12:00:00

I'm looking for Javascript code for letting the user draw a line (on an image).



Just as the line tool in Photoshop (for example):



The user clicks on the image, drags the mouse (while the line between the start point and the mouse point is dynamically drawn on mouse drag).



I would also need a callable function to send the page the start and end coordinates.



I've found this very nice script for area selection:
http://www.defusion.org.uk/code/javascript-image-cropper-ui-using-prototype-scriptaculous/



and I've found many script for drawing lines (and other shapes in JS), but could not find what I'm looking for.



Thanks


More From » line

 Answers
118

Since there is no standard method of drawing, if you want to support older browsers and IE,
you will need to use a library. The library will handle the cross platform issues of drawing with SVG or Microsoft's VML



I recommend Raphael JS


[#97255] Sunday, March 21, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
harleyaleenag

Total Points: 678
Total Questions: 121
Total Answers: 105

Location: Papua New Guinea
Member since Thu, Jul 9, 2020
4 Years ago
harleyaleenag questions
Thu, May 5, 22, 00:00, 2 Years ago
Wed, Aug 19, 20, 00:00, 4 Years ago
;