日期:2014-05-17  浏览次数:21140 次

c# 报错 参数无效
我 把扫描仪扫到的一些图片保存到本地之后读取,因为有很多所以 加了一 FlowLayoutPanel 控件
在flp控件上有加了一个panel控件,在panel控件上 有加了一个picturebox控件,当我点击picturebox  时,获取image,赋给我页面上的另一个picturebox(显示大小图片),在我显示大小图片的这个pic控件上我做了一个左右旋转的功能,但是当我左右旋转的时候图片是旋转的,但是过一会他就会 报错 ,提示我 参数无效?
因为我 引用了两个第三方 的dll,我想问一下,是我引dll的问题吗??一下是 报错 信息

2013-06-18 13:51:10    参数无效。
   在 System.Drawing.Image.get_Width()
   在 System.Drawing.Image.get_Size()
   在 System.Windows.Forms.PictureBox.ImageRectangleFromSizeMode(PictureBoxSizeMode mode)
   在 System.Windows.Forms.PictureBox.OnPaint(PaintEventArgs pe)
   在 System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
   在 System.Windows.Forms.Control.WmPaint(Message& m)
   在 System.Windows.Forms.Control.WndProc(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   在 System.Windows.Forms.Application.Run(Form mainForm)
   在 GreatHandFFs.UI.Program.Main() 位置 C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\GreatHandFFs.root\GreatHandFFs\GreatHandFFs.UI\Program.cs:行号 51


求大神 指点 一下 ,异常的source  是 System.Drawing

------解决方案--------------------
肯定是跟读取图片信息有关,你好好跳是不,一步步旋转,看看什么条件下报错
------解决方案--------------------
认真检查每一步,肯定有细节问题!
------解决方案--------------------
请检查看看,如果是不是已经image.Dispose();释放了,如果释放了,就把//image.Dispose();这个注释掉看看。
------解决方案--------------------
建议贴出来你旋转的代码,以及出错的代码。
从错误信息上只能看出来是在获取对象宽度的时候出错了!
------解决方案--------------------
你可以这样操作看看,等你把所以的事情都做完后,在一一的Dispose()释放资源。没有完成的时候,可以先别急这Dispose(),看看还会不会出现这种问题。