Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i am developing a website where i want to place a drawing area
and in that area user should be able to draw polygons,straight lines and circles
anyone can help with this ? maybe redirect me to some source where i can learn how to draw
Posted

1 solution

The best and most reasonable way to do it is to use HTML5 Canvas feature: http://en.wikipedia.org/wiki/Html5_canvas[^].

It will take considerable effort, but what you can do is quite impressive:
http://net.tutsplus.com/articles/web-roundups/21-ridiculously-impressive-html5-canvas-experiments/[^].

You can find several engines already designed, in particular, for creation of vector graphics interactively by the user:
Raphaël: http://raphaeljs.com/[^],
CAKE: http://code.google.com/p/cakejs/[^],
Paper.js, a vector-graphics scripting network: http://paperjs.org/[^],
Burst Engine: https://github.com/rwaldron/burst-core[^].

See also this Mozilla tutorial: https://developer.mozilla.org/en-US/docs/Web/Guide/Graphics/Drawing_graphics_with_canvas?redirectlocale=en-US&redirectslug=HTML%2FCanvas%2FDrawing_Graphics_with_Canvas[^].

—SA
 
Share this answer
 
v5
Comments
mughees ilyas 3-Dec-13 13:11pm    
umm all of them are html oriented not asp.net specific
and most of the sites dont show how to use html5 canvas in asp.net enviornment
Sergey Alexandrovich Kryukov 3-Dec-13 13:19pm    
It should not be ASP.NET specific! What, do you want a postback on any user action? It would be prohibitively slow.
What I advise is really a way to go.

And what you say about "most site" is not just a false statement, this is gibberish which makes no certain sense. A site cannot "know" about what is on client site. HTML5 is well supported these days.
—SA
Thomas Daniels 3-Dec-13 13:33pm    
Why do you want an ASP.NET-specific canvas? You can simply include the HTML and JavaScript code in your ASP.NET page. If you want to draw something on the canvas from the server-side code (C# or VB.NET), then you should create a JavaScript function that can draw something and call this function from your server-side code.
Sergey Alexandrovich Kryukov 3-Dec-13 17:56pm    
Exactly. However, you never call Javascript functions from server-side code. Server side only writes HTML with Javascript and other content, and Javascript is called by a browser.
Actually, when the application is interactive, no matter what happens on the server-side, main work is always done on client side, by definition, because this is, well... interactive.
And client-side is, by definition, not ASP.NET (or anything else) specific.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900