Image manipulation in asp.net/c# without System.Drawing/GDI+

后端 未结 4 2105
春和景丽
春和景丽 2021-02-08 02:50

Is there any alternative image manipulation library for .net? I would prefer something that is managed and open source.

I ask this because of two reasons:

相关标签:
4条回答
  • 2021-02-08 03:18

    I don't know of any fully-managed 2D drawing libraries that are either free or open-source (there appears to be a few commercially available, but OSS is the way to go). However, you might look into the Mono bindings to Cairo.

    Cairo is a platform independent 2D drawing API. You can find more information about it at the Cairo homepage. The Cairo Wikipedia page also has some good info.

    Cairo is also used fairly widely in the Open Source world, which to me says something about its robustness. Mozilla, Webkit, and Mono all use it, among others. Ironically, Mono actually uses it to back their System.Drawing implementation... go figure.

    There might also be a way to use Mono's System.Drawing implementation as a drop-in replacement for the Microsoft implementation, though I'm not sure how or if that would even work. I would probably start by replacing the System.Drawing.dll reference with Mono's version, and then try to deal with any errors.

    0 讨论(0)
  • 2021-02-08 03:20

    With respect to (1), most of the hard to debug errors are due to not closing open handles (Dispose() in managed-land). I'm curious where you heard (2).

    0 讨论(0)
  • 2021-02-08 03:26

    You should look into the WPF Imaging libraries shipped with .NET 3.0. They're optimized and robust (used to run Aero, so you know they're efficient). They don't depend on the WPF dispatcher, are easily extensible, and officially supported. What more could you want?

    0 讨论(0)
  • 2021-02-08 03:33

    Anecdotal evidence #1: I have used GDI+ for on-the-fly image creation within ASP.NET with no problems. I'm not sure what the problems would even be.

    0 讨论(0)
提交回复
热议问题