Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graphics in ASP.Net (c#)

I need help with my latest asp.net project. It involves graphics. I need to draw a circle and have several lines going from the middle to the edge (radius). This is the part I know how to do. The next part is the part I don’t know how to do and would appreciate some advice. The users need the ability to grab the lines with their mouse and move them. For example if a line is pointing to the 90 degree mark, they might want to grab it and move it to the 45 degree mark. This will affect calculations that will display elsewhere on the page.

I will consider third party controls but would prefer a solution with coding or open source controls.

Thanks in advance.

Bob Avallone

like image 822
Bob Avallone Avatar asked Jan 15 '10 15:01

Bob Avallone


People also ask

What is graphics in C#?

The Graphics object represents a GDI+ drawing surface, and is the object that is used to create graphical images. There are two steps in working with graphics: Creating a Graphics object. Using the Graphics object to draw lines and shapes, render text, or display and manipulate images.

What are graphic images?

A graphic or graphic image is a visual representation of non-textual content, such as a painting, a chart or a photograph.

What is GDI+ in C#?

GDI+ is the portion of the Windows operating system that provides two-dimensional vector graphics, imaging, and typography. GDI+ improves on GDI (the Graphics Device Interface included with earlier versions of Windows) by adding new features and by optimizing existing features.


2 Answers

ASP.net runs on the server - it simply generates HTML (& JavaScript) which is sent to the client (eg a browser) and rendered there.

So what you need is not an asp.net solution, but indeed a rich client solution. Some of your options are:

  • Javascript
  • Flash
  • Silverlight
  • Java applet

I suspect Javascript or Silverlight will be of the most interest to you. Perhaps you want to do a little investigation, and come back with an updated question.

UPDATE Re: Bob's Comment:

A quick google found this, which seems pretty cool:

Lightweight Visual Thesauras

like image 74
Winston Smith Avatar answered Sep 22 '22 02:09

Winston Smith


You could possibly use an svg to do the work for you, maybe modifying the work on

http://www.maa.org/joma/Volume7/Lane/Developer.html

the specific example is:

http://www.maa.org/joma/Volume7/Lane/Thales.svg

like image 20
John Boker Avatar answered Sep 21 '22 02:09

John Boker