Image fromstream issue(图片来自流问题)
问题描述
我在从流创建图像时遇到问题.在我的 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>
这篇关于图片来自流问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:图片来自流问题
基础教程推荐
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- WPF 模态进度窗口 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
