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>
这篇关于图片来自流问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:图片来自流问题
基础教程推荐
- 更新 Visual Studio 中的 DataSet 结构以匹配新的 SQL 数据库结构 2022-01-01
- 将数据集转换为列表 2022-01-01
- Mono https webrequest 失败并显示“身份验证或解密失败" 2022-01-01
- 如果条件可以为空 2022-01-01
- 重新排序 WPF TabControl 中的选项卡 2022-01-01
- 从 C# 控制相机设备 2022-01-01
- 获取C#保存对话框的文件路径 2022-01-01
- C# 9 新特性——record的相关总结 2023-04-03
- SonarQube C# 分析失败“不是指针的有效行偏移" 2022-01-01
- 在 VB6 或经典 ASP 中使用 .NET 2022-01-01
