tags:

views:

143

answers:

6
+3  Q: 

Drawing with .NET

I am looking for some Drawing class (Package) that will enable me in a easy way to draw images like the following.

alt text

I have no Experience with Drawing so I will be glad to hear suggestions.

My pic link

+4  A: 

Have a look at the GDI+ classes in the System.Drawing namespace.

Edit: I am really not sure what you mean when you keep asking for more abstract libraries. How are these classes not abstract enough? Graphics.DrawLine(), Graphics.FillEllipse() and so on.

Unless you are looking to do something very specific, like charting for instance, there is no other abstraction on top of this. You do want to draw lines, polygons, rectangles etc., don't you?

Can you explain what abstraction you would want? In pseudo code?

Wim Hollebrandse
GDI+ is too match low lever as i understand it. I am looking something match more abstract.
Night Walker
It's not *that* low level. Have you checked out the classes in the link I sent you? Especially the `Graphics` class, which contains methods like `DrawEllipse()`, `DrawPolygon()`, `DrawLine()`, `FillRectangle()` etc. How much higher level do you want? `DrawNicePicture()`?
Wim Hollebrandse
A: 

GDI+ is definitely a good way to go. Depending on your application constraints you could also look at WPF and Silverlight (for Windows / Web respectively) as you can do some complicated drawing and animation in XAML alone.

Sam Meldrum
A: 

A few simple starter links

cyberzed
A: 

GDI+ is definitely the way to go, your other option is Direct3D or OpenGL. Since you declined GDI+, srap the Direct3D and OpenGL ideas too.

GDI+ is pretty abstract and it's super easy to setup and once you are used to the way you draw with the lib, you will find it's pretty straight forward.

PieterG
I am looking for some abstract libraries, I don't want to start drawing with brasher like it done in GDI + .
Night Walker
A: 

Go to Paint.NET 3.5 and download source code, play around with it and you will probably get a good grip on what you want.

lakhlaniprashant.blogspot.com
The source code for Paint.NET 3.5 is **not** provided, but source code for older versions of Paint.NET can be found elsewhere. See e.g. http://stackoverflow.com/questions/9603/what-is-some-great-source-code-to-read/9663#9663
Peter Mortensen
A: 

If you do not need user interaction for drawing and you are creating the images directly via code getting the geometric information from a different source than you might consider creating svg files and displaying them.

I use this approach for a current project where i want to show the topology of a building. I get the geometry from Autodesk Revit through the API and afterwards i create the topology map in svg. Since svg is xml it is easy to manipulate. Since it is vector based there are no limits to what you can achive. BTW Inkskape is a open source vector grafik editor which might help you to find out how to represent more complex thinks in svg.

Just my two cent :-)

da8