图片来自流问题 [英] Image fromstream issue

查看:28
本文介绍了图片来自流问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在从流创建图像时遇到问题.在我的 Windows 电脑上,它分叉很好,在 ubuntu 服务器上,它抛出一个错误

i have problems during creating image from stream. on my windows pc it forks great, on ubuntu server, it throws an error

System.ArgumentException:在 System.Drawing.GDIPlus.CheckStatus (System.Drawing.Status)<0x00157> 处发现空引用或无效值 [GDI+ 状态:InvalidParameter]在 System.Drawing.Image.CreateFromHandle (intptr) <0x00027>在 System.Drawing.Image.LoadFromStream (System.IO.Stream,bool) <0x0002b>在 System.Drawing.Image.FromStream (System.IO.Stream,bool,bool) <0x00013>

我检查了我服务器上的 System.Drawing 库设置,它说 system.drawing 已安装

I checked System.Drawing library setup on my server, it says that system.drawing is installed

单测试安装

你有一个有效的 System.Drawing 设置

有什么想法吗?

推荐答案

首先,找到System.Drawing.dll文件所在的目录(例如/opt/mono-4.4.0/lib/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll).

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.config的文件,内容如下,将目录更新到libgdiplus.so的正确位置:

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:

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

这篇关于图片来自流问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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