简体   繁体   English

来自streamstream的图片

[英]Image fromstream issue

i have problems during creating image from stream. 从流创建图像时遇到问题。 on my windows pc it forks great, on ubuntu server, it throws an error 在我的Windows PC上,它分叉得很好,在ubuntu服务器上,它抛出一个错误

System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter] at System.Drawing.GDIPlus.CheckStatus (System.Drawing.Status) <0x00157> at System.Drawing.Image.CreateFromHandle (intptr) <0x00027> at System.Drawing.Image.LoadFromStream (System.IO.Stream,bool) <0x0002b> at System.Drawing.Image.FromStream (System.IO.Stream,bool,bool) <0x00013>

I checked System.Drawing library setup on my server, it says that system.drawing is installed 我检查了服务器上的System.Drawing库设置,它说已安装了system.drawing

mono-test-install

Your have a working System.Drawing setup

any ideas? 有任何想法吗?

First, locate the directory where is the System.Drawing.dll file (for example /opt/mono-4.4.0/lib/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ). 首先,找到System.Drawing.dll文件所在的目录(例如/opt/mono-4.4.0/lib/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll )。

Create a file in the same directory called System.Drawing.dll.config with the following content, updating the directory to the correct location of libgdiplus.so : 在具有以下内容的同一目录中创建一个名为System.Drawing.dll.config的文件,并将目录更新为libgdiplus.so的正确位置:

<configuration>
  <dllmap dll="gdiplus.dll" target="/opt/mono-4.4.0/lib/libgdiplus.so"/>
</configuration>

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

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