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 about where to begin.
Thank You, Andrew
2D graphics are very important in the control peripherals such as printers, plotters, sheet cutting machines, etc. They were also used in most early video games; and are still used for card and board games such as solitaire, chess, mahjongg, etc.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With