C# 2d interactive graphics library [closed]

2019-04-17 14:22发布

问题:

i'm looking for a library (preferably MIT/LGPL style, will explore commercial ones as well) to replace my application's System.Drawing interactive 2d graphics. i have a large c#.net application with many types of objects. these objects need to be represented by rectangles and trapezoids that can be moved around by the user on a canvas and dynamically change colors based on location and overlaps while keeping values in the objects synchronized. it is currently working with the built in GDI+ libraries but it doesn't look very attractive and is a bit buggy and slow, especially when there is a large number of objects. as a bonus it would be nice to be able to easily display maps, select longitude/latitude coordinates, and draw on top of it. anybody know of a magic library that does it all? ;)

回答1:

Try WPF.

With WPF, you're coding a GUI application which uses DirectX instead of GDI to display its widgets. And both 2D and 3D graphics are easily available, enabling you to produce both what you describe in your question, and quite advanced (and flashing/amazing/etc.) 2D and 3D effects with but a few XML tags.



回答2:

Have you checked out XNA? It's Microsoft's standard way to use DirectX from .NET languages, and there's a lot of samples and support out there for it. It comes with a whole range of 2D and 3D APIs, as well as input and audio stuff.



回答3:

Is this a mapping application? If so you might want to look at this blog entry, it uses a commercial library I worked on. fast scrolling sample