开发者

Drawing with .NET

开发者 https://www.devze.com 2022-12-18 21:55 出处:网络
I am looking for some Drawing class (Package) that will enable me in a easy way to draw images like the following.

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

alt text http://www.freeimagehosting.net/uploads/e96ab74410.jpg

I 开发者_JAVA技巧have no Experience with Drawing so I will be glad to hear suggestions.

My pic link


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?


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.


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.


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 :-)


GDI+ is definitely the way to go, your other option is Direct3D or OpenGL. Since you declined GDI+, discard 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号