[英]Image fromstream issue
從流創建圖像時遇到問題。 在我的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>
我檢查了服務器上的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>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.