views:

273

answers:

3

I would like to create an online, simple WYSIWYG drawing editor allowing people to draw rectangular shapes. I'm thinking of a grid which the lines and points can snap on to, ensuring that the lines are strictly vertical or horizontal. I will be parsing the rectangular shapes to obtain some area calculations and compute certain things. How can I achieve the drawing ability? The new canvas tag is good but people have been telling me that IE does not support it. I found some Java applets but I have never programmed in Java before. Is there a way to do this using pure javascript or jquery? Does ASP.NET help at all?

Thanks.

+1  A: 

You're absolute best bet is to learn flash or silverlight. Trying to do this in plain old html / javascript is going to be a huge PITA... if you even get it working.

Chris Lively
+1 (or an applet)
clyfe
Flash seems to be a good solution. Let's say a user draws a few rectangles. Will I be able to parse the generated drawing for elements' dimensions relative to say, a grid on which I superimpose the rectangles?
Dhruv
+1  A: 

For vertical and horizontal lines you can simply use thin divs with a background, defined size and absolute position. Really simple to code and will work everywhere. You'd need canvas for anything more than strictly vertical/horizontal ones though.

Max Shawabkeh
A: 

You can definetly use canvas, and emulate it on IE with one of the libs:
http://code.google.com/p/gwt-canvas/
http://excanvas.sourceforge.net/
But take care on performance. Chris Lively has a point.

clyfe