有关调用实时(JIT)调试而不是此对话框的详细信息,
请参见此消息的结尾。
************** 异常文本 **************
System.IndexOutOfRangeException: 索引超出了数组界限。
在 XiaoLiJishu.Form1.areas(Byte[,] img, Int32 w, Int32 h) 位置 D:\VS项目\XiaoLiJishu\XiaoLiJishu\MainForm.cs:行号 599
在 XiaoLiJishu.Form1.euler(Byte[,] img, Int32 w, Int32 h) 位置 D:\VS项目\XiaoLiJishu\XiaoLiJishu\MainForm.cs:行号 579
在 XiaoLiJishu.Form1.toolStripMenuItem2_Click(Object sender, EventArgs e) 位置 D:\VS项目\XiaoLiJishu\XiaoLiJishu\MainForm.cs:行号 558
在 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
在 System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
在 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
在 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
在 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
在 System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
在 System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
在 System.Windows.Forms.ToolStrip.WndProc(Message& m)
在 System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** 已加载的程序集 **************
mscorlib
程序集版本:4.0.0.0
Win32 版本:4.0.30319.34209 built by: FX452RTMGDR
XiaoLiJishu
程序集版本:1.0.0.0
Win32 版本:1.0.0.0
System.Windows.Forms
程序集版本:4.0.0.0
Win32 版本:4.0.30319.34251 built by: FX452RTMGDR
System.Drawing
程序集版本:4.0.0.0
Win32 版本:4.0.30319.34209 built by: FX452RTMGDR
System
程序集版本:4.0.0.0
Win32 版本:4.0.30319.34238 built by: FX452RTMGDR
System.Configuration
程序集版本:4.0.0.0
Win32 版本:4.0.30319.34209 built by: FX452RTMGDR
System.Xml
程序集版本:4.0.0.0
Win32 版本:4.0.30319.34234 built by: FX452RTMGDR
mscorlib.resources
程序集版本:4.0.0.0
Win32 版本:4.0.30319.18408 built by: FX451RTMGREL
System.Windows.Forms.resources
程序集版本:4.0.0.0
Win32 版本:4.0.30319.18408 built by: FX451RTMGREL
************** JIT 调试 **************
要启用实时(JIT)调试,
该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置
jitDebugging 值。
编译应用程序时还必须启用
调试。
例如:
启用 JIT 调试后,任何未经处理的异常
都将被发送到在此计算机上注册的 JIT 调试器,
而不是由此对话框处理。
这几行代码分别为
for(int i=0;i<h;i++)
for(int j=0;j<w;j++)
if(outp[i,j]==1) img[i,j]=7;//-1 第599行
图片像素太多了,换一张图片
你的程序能通过编译,说明没有语法问题
应该是运行时错误,很显然是一个静态数组在运行过程中,程序对数组下标的访问超出了数组的长度
大多数错误出现于用数组的长度作为下标,但事实上数组下标的最大值应该为数组的长度减一
建议你再仔细检查一下有关数组使用的代码快的合法性
XiaoLiJishu.Form1.areas(Byte[,] img, Int32 w, Int32 h)
这个方法中,你试图访问了img数组,下标超过了边界,调试下。注意循环的边界值。
断点调试,找到出错的地方,把索引值改为数组大小减一,因为数组下标是从0开始的
错误提示明显,打断点跟进吧