简体   繁体   English

.net,mono和silverlight的图形库

[英]Graphics library for .net, mono and silverlight

I have a C# application which renders 2D graphics into bitmaps using System.Drawing.Graphics. 我有一个C#应用程序,它使用System.Drawing.Graphics将2D图形渲染成位图。 I now want to port this application to work on normal .net on windows, mono on linux and in Silverlight/Moonlight. 我现在想要将此应用程序移植到Windows上的普通.net,Linux上的单声道和Silverlight / Moonlight中。

But at least Silverlight is lacking System.Drawing. 但至少Silverlight缺少System.Drawing。 Since I don't want to maintain several copies of my rendering code I need one cross platform graphics library. 由于我不想维护我的渲染代码的几个副本,我需要一个跨平台的图形库。

I see a few alternatives to achieve that: 我看到了一些替代方案来实现这一目标:

  1. Use a library available on all platforms 使用所有平台上提供的库
  2. Use a port of System.Drawing to silverlight 使用System.Drawing的端口来进行silverlight
  3. Write a wrapper around the graphics libraries of the different platforms myself 自己在不同平台的图形库周围写一个包装器

I'm trying to avoid 3) due to the required work. 由于所需的工作,我试图避免3)。 So does anybody know a free library for 1) or 2)? 那么有人知道1)或2)的免费图书馆吗? Library should have a reasonable license, ie free and not GPL (LGPL is fine). 图书馆应该有合理的许可证,即免费而非GPL(LGPL是好的)。

  1. There is no common library that does the sort of things that System.Drawing does. 没有公共库可以完成System.Drawing所做的事情。
  2. This would be a massive undertaking for very little payback. 这将是一项巨额承诺,收益甚微。
  3. Of these options this is the only one that is viable. 在这些选项中,这是唯一可行的选项。

I'm not sure what sort of graphics you are doing but have you considered XNA? 我不确定你在做什么样的图形,但你考虑过XNA吗? I don't know about its Mono credentials but via Silversprite you might be able to build stuff that compiles for both .NET and Silverlight. 我不知道它的Mono凭据,但通过Silversprite你可以构建编译.NET和Silverlight的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM