开发者

What is a good 2D graphics framework, for a drawing application?

开发者 https://www.devze.com 2022-12-13 11:49 出处:网络
I am trying to build a raster drawing application using C# and so far I have not been able to locate any versatile light weight 2D graphics frameworks, or guides.

I am trying to build a raster drawing application using C# and so far I have not been able to locate any versatile light weight 2D graphics frameworks, or guides.

I was hoping a few of you would be able to give me a good head start because currently my choices are using GDI+ or WPF and that is about it :(...

Basically I need something simple that will provide me with the ability to create a Canvas, Layers, Brushes, and the ability to import/export all of these things. I have looked through several graphic applications to see how they implemented their tools and looked online for books and have come out with no knowledge abo开发者_StackOverflow社区ut where to begin.

Thank You, Andrew


You don't mention if you want to make a vector editor or a raster editor. I'm assuming raster.

If you don't have much graphics API experience, and just want to get something working as soon as possible, just go with GDI+. It is much simpler than WPF conceptually.

Both GDI+ and WPF can do what you want. Working with WPF will probably give better performance because it uses Direct-X for acceleration. It also uses a stored-scene paradigm, which may make a lot of drawing operations conceptually simpler. The learning curve is much higher than GDI+, though.

You could always use Open-GL, Direct-X, or unmanaged GDI. They all have good 2D performance. But you will have to make calls to unmanaged code.


Well, two things.

One, you can take a look at Paint.Net. It is a free .Net program for working with 2D Graphics. Using the plugin model, you may be able to solve whatever problem you are working on more easily.

Second, a good 2D graphics library is SDL.Net. It's a set of OO wrappers for the C SDL library, and makes drawing 2D images pretty easy. I don't know if it will offer support for all of the more "manipulation" questions you have, though.


If you are trying to learn 2D graphics, WinForms is much easier to learn than WPF. WinForms supports brushes, canvases, multiple graphics formats, file import/export, and such.

The Code Project site has many WinForms graphics tutorials, try starting here.


Piccolo 2D is a 2d gfx framework for Java and C#. Free, open-source. Provides a scene graph, etc. Zoomable. Looks good.


The XNA framework is easy use and performs well since it is actually just a wrapper for DirectX. The big advantage is that you can write all your code in managed C#. Have a look at this post on the xna forum to see how you can read out the display for export.


There is also the Tao framework, which allows you to use either OpenGL or SDL for your drawing needs. It also is a set of OO wrappers around each. There are quite a few tutorials out there on Google for getting started as well.

Tao Framework

0

精彩评论

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