Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Basic 2D graphics library

Tags:

c#

.net

graphics

I'm looking for a basic graphics library/framework/package (for .NET) that would allow me to create simple 2D diagrams similar to those displayed in Visual Studio Code Maps: enter image description here
(source: microsoft.com)
.
Is there anyway to determine what technology was used to develop the Code Maps application?

My goal is to implement a lightweight animated graphical display of a Finite State Machine to support the debugging of a simulation application. I'm guessing Code Maps was written in WPF, but unfortunately the developers on my team don't have any WPF/XAML experience, so I am hesitant to invest in that learning curve if a simpler approach is available. Can anybody point me to any other libraries that can help me build a simple custom GUI like this?

Related Questions:

  • C# 2d interactive graphics library - answers focus on WPF and XNA, but as I said, I'm looking for something a bit more approachable (read: quicker turn-around for non-experienced devs).
  • How do I draw simple graphics in C#? - 5 year old answers which recommend System.Drawing and GDI+. That's a bit too low-level for us at this point.
like image 822
kmote Avatar asked Oct 23 '25 14:10

kmote


2 Answers

I suppose what was used is this technology from Microsoft Research: Microsoft Automatic Graph Layout

MSAGL is a .NET tool for graph layout and viewing. It was developed in Microsoft Research by Lev Nachmanson. MSAGL is built on the principle of the Sugiyama scheme; it produces so called layered, or hierarchical layouts. This kind of a layout naturally applies to graphs with some flow of information. For example, the graph could represent a control flow graph of a program, a state machine, or a C++ class hierarchy.

If you're an MSDN subscriber, you can have it for free (to be checked), otherwise it's a commercial package.

like image 176
Simon Mourier Avatar answered Oct 25 '25 04:10

Simon Mourier


There's no need to either suffer the hellish torment and pain involved in doing anything like that in winforms, nor paying $$$$ amounts for third-party solutions.

Here is my simple, less-than 100 lines of code approach for such a thing (full source code included).

enter image description here

It doesn't have the "automatic layout" algorithms, but the UI is well-separated from the data and logic, by implementing MVVM. Therefore it should be easy for you to create your own layout logic.

Forget winforms. it's useless.


unfortunately the developers on my team don't have any WPF/XAML experience

This might be a really good chance to learn it. And be free from the many limitations imposed by ancient technologies.

Once you know and learn the power of XAML and WPF's DataBinding, you will NEVER want to go back to crappy procedural winforms. Seriously.

The simplicity, maintainability, and cleanliness provided by (correctly implemented) MVVM is by far more than anything you can ever hope to achieve in winforms, or anything else.

like image 39
Federico Berasategui Avatar answered Oct 25 '25 03:10

Federico Berasategui