首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >System.Drawing.GDIPlus.CheckStatus System.Drawing.Image.FromFile System.ArgumentException [GDI+ status: InvalidParameter]

System.Drawing.GDIPlus.CheckStatus System.Drawing.Image.FromFile System.ArgumentException [GDI+ status: InvalidParameter]
EN

Stack Overflow用户
提问于 2015-09-12 13:23:20
回答 1查看 2.6K关注 0票数 2

事实上,Raspberry PI 2. $ uname -a Linux raspberrypi 3.18.7-v7+ #755 SMP抢占清华2月12日17:20:48 GMT 2015 armv7l GNU/Linux

$ mono -版本Mono JIT编译器版本3.2.8 (Debian 3.2.8+dfsg-4+rpi1 1)

代码语言:javascript
复制
getImageFromFile=images/complex/complex C3.jpg
loadOverlayImages plant life loadImages
getImageFromFile=images/butterfly/animated-butterfly-image-0004.gif
fn=images/butterfly/animated-butterfly-image-0004.gif  targetDir=images/butterfly  PlantImage.GetFrameCount=5 for file:images/butterfly/animated-butterfly-image-0004.gif
getImageFromFile=images/butterfly/animated-butterfly-image-0005.gif
ERROR: getImageFromFile- System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter]
  at System.Drawing.GDIPlus.CheckStatus (Status status) [0x00000] in <filename unknown>:0
  at System.Drawing.Image.FromFile (System.String filename, Boolean useEmbeddedColorManagement) [0x00000] in <filename unknown>:0
  at System.Drawing.Image.FromFile (System.String filename) [0x00000] in <filename unknown>:0
  at PlantLifeAnimationForm.PlantLifeImagesService.getImageFromFile (System.String filePath) [0x00015] in     /home/pi/emgucv/PlantLifeAnimation/PlantLifeAnimationForm/model/PlantLifeImagesService.cs:223
fn=images/butterfly/animated-butterfly-image-0005.gif  targetDir=images/butterfly
Unhandled Exception:

此文件在windows上运行良好(在此模具:System.Drawing.Image.FromFile(filePath) )。

代码语言:javascript
复制
            using (Bitmap temp = (Bitmap)System.Drawing.Image.FromFile(filePath))
            {
                bitmapSource = (Bitmap)temp.Clone();
            }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-09-12 17:11:57

看看这个单一的bug - bug.cgi?id=510805。基本上,他们说的是像你这样的问题发生时,libgif不能处理提供的gif。例如,对于您的图像gifinfo (它是libgif-tools包的一部分)说:

图8不限于屏幕维数,已中止。

我还必须警告您,如果您在mono上进行任何严肃的图像处理--避免使用标准位图和相关类,它们在许多方面都是错误的(根据我自己的新鲜经验)。对于大多数图像操作,我直接使用MagickWand C(通过p调用)。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32539334

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档