PictureBox 显示GIF的问题:
有些GIF图片显示到了最后一帧时就报错,为什么呢?要怎样解决?(imageready显示这个gif文件是没有问题的)System.Runtime.InteropServices.ExternalException: GDI+ 中发生一般性错误。
   at System.Drawing.Image.SelectActiveFrame(FrameDimension dimension, Int32 frameIndex)
   at System.Drawing.ImageInfo.UpdateFrame()
   at System.Drawing.ImageAnimator.UpdateFrames()
   at System.Windows.Forms.PictureBox.OnPaint(PaintEventArgs pe)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

解决方案 »

  1.   

    是你的gif文件有问题吧,我这测试过,放了一个几帧的gif,都没有问题
      

  2.   

    如果是这个GIF有问题。那应该怎样处理呢?
      

  3.   

    有没有什么办法捕获这个错误呢?试过Try Catch ex As Exception无效
      

  4.   

    如果是gif问题,重新做个gif就行
      

  5.   

    gif是客户上传的。我怎么知道以后上传的有没有问题呢?难道是显示错误才去处理。
      

  6.   

    我在vb.net也遇到了这个问题,gif没有问题,高手来指点一下吧
      

  7.   

    我使用代码生成一个picbox来显示gif图片,到最后一桢就报错,也是GDI+ 中发生一般性错误。直接在窗体上用picbox控件没有问题