我在Linux上的C#中使用.net core,lib System.Drawing丢失 [英] I am using .net core with C# on linux, lib System.Drawing is missing

查看:457
本文介绍了我在Linux上的C#中使用.net core,lib System.Drawing丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


Program.cs(1,14):错误CS0234:类型或名称空间名称'Drawing'
在名称空间'System'中不存在(您是否缺少程序集
参考?

Program.cs(1,14): error CS0234: The type or namespace name 'Drawing' does not exist in the namespace 'System' (are you missing an assembly reference?

是否可以解决该问题?或者如果我正在开发,则不是要使用此lib?在Linux中使用C#?

Is it possible to fix that? or I am not meant to be using this lib, if I am developing in Linux with C#?

推荐答案

System.Drawing 命名空间位于目前还不是corefx的一部分,因为它依赖于Windows的GDI +功能。

The System.Drawing namespace is at the moment not part of corefx as it relies on the GDI+ features from Windows.

但是有计划在将来提供支持。

But there are plans to support it in the future.

但是有多种选择:

CoreCompat。 System.Drawing


CoreCompat.System.Drawing是System的Mono实现的.NET Core端口。绘图。在.NET Framework和Mono中,System.Drawing的CoreCompat.System.Drawing也依赖Windows上的GDI +。因此,出于同样的原因,建议使用警告。

CoreCompat.System.Drawing is a .NET Core port of the Mono implementation of System.Drawing. Like System.Drawing in .NET Framework and in Mono, CoreCompat.System.Drawing also relies on GDI+ on Windows. Caution is therefore advised, for the same reasons.

ImageSharp


ImageSharp是全新的纯托管代码,以及跨平台的图像处理库。其性能不如依赖于本机特定于操作系统的库的性能好,但是它仍然非常合理。它唯一的依赖项是.NET本身,这使其具有极大的可移植性:无需安装其他软件包,只需引用ImageSharp本身,就可以完成。

ImageSharp is a brand new, pure managed code, and cross-platform image processing library. Its performance is not as good as that of libraries relying on native OS-specific dependencies, but it remains very reasonable. Its only dependency is .NET itself, which makes it extremely portable: there is no additional package to install, just reference ImageSharp itself, and you’re done.

> Magick.NET


Magick.NET是流行的ImageMagick库的.NET包装器。 ImageMagick是一个开放源代码,跨平台的库,着重于图像质量,并提供了广泛的受支持图像格式选择。它对EXIF的支持也与ImageSharp相同。

Magick.NET is the .NET wrapper for the popular ImageMagick library. ImageMagick is an open-source, cross-platform library that focuses on image quality, and on offering a very wide choice of supported image formats. It also has the same support for EXIF as ImageSharp.

(Magick.NET的.NET Core构建当前仅支持Windows。)

(The .NET Core build of Magick.NET currently only supports Windows.)

SkiaSharp


SkiaSharp是Google的Skia跨平台2D图形库的.NET包装,由Xamarin团队维护。 SkiaSharp现在与.NET Core兼容,并且速度非常快。

SkiaSharp is the .NET wrapper for Google’s Skia cross-platform 2D graphics library, that is maintained by the Xamarin team. SkiaSharp is now compatible with .NET Core, and is extremely fast.

FreeImage-dotnet-core


此库对本机FreeImage库而言,就像Magick.NET对ImageMagick一样:.NET Core包装器。它提供了不错的图像格式选择,良好的性能和良好的视觉效果。

This library is to the native FreeImage library what Magick.NET is to ImageMagick: a .NET Core wrapper. It offers a nice choice of image formats, good performance, and good visual quality.






这里很好上述库的示例和性能分析。


Here are some good examples and performance analyses of the libraries mentioned above.

这篇关于我在Linux上的C#中使用.net core,lib System.Drawing丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆