tags:

views:

40

answers:

2

A stupid question here:

is there such a library to do these stuff? I want a more advanced library than system.drawing namespace.

+1  A: 

You can look at Open Diagram at codeplex:

http://opendiagram.codeplex.com/

James Westgate
it's pretty cool, but I want to draw my own drawings, the lib seems can't do low level stuff.
Benny
If you want a retained mode graphics system, then WPF is probably a better bet .... Open Diagram does provide you with a graphics object to do your own drawing within each class.
James Westgate
+2  A: 

It's not GDI+, but have you considered using the System.Windows.Media.Imaging api (New since .Net 3.0).

It offers some better drawing abilities like the DrawGeometry(...) method.

First create a DrawingVisual and a DrawingContext:

DrawingVisual visual = new DrawingVisual();
DrawingContext dc = visual.RenderOpen();

Then draw stuff on it:

dc.DrawRectangle(...);
dc.DrawText(...);
dc.DrawGeometry(...);
etc...

Make sure you close it:

 dc.Close();

Once you have your visual object you can render it in WPF window or render it to a file. You can also use use a WPF Canvas as the visual object in the first place.

There are some good MS Tutorials on Drawing Objects, Using DrawingVisual Objects and WPF Graphics Rendering.

Simon P Stevens
Yes, Wpf has better feature.
Benny