我在从流创建图像时遇到问题。在我的 Windows 电脑上,它分叉得很好,在 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>
我检查了服务器上的 System.Drawing 库设置,它表示已安装 system.drawing
mono-test-install
Your have a working System.Drawing setup
有任何想法吗?
首先,找到System.Drawing.dll文件所在的目录(例如/opt/mono-4.4.0/lib/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
).
在同一目录中创建一个名为System.Drawing.dll.config
包含以下内容,将目录更新到正确的位置libgdiplus.so
:
<configuration>
<dllmap dll="gdiplus.dll" target="/opt/mono-4.4.0/lib/libgdiplus.so"/>
</configuration>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)