??560 2015-05-27 14:02 采纳率: 63.6%
浏览 2980

C#数字图像处理出现“索引超出了数组界限”的异常,求帮忙

有关调用实时(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

基本代码:file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

XiaoLiJishu
程序集版本:1.0.0.0
Win32 版本:1.0.0.0

基本代码:file:///D:/VS%E9%A1%B9%E7%9B%AE/XiaoLiJishu/XiaoLiJishu/bin/Debug/XiaoLiJishu.exe

System.Windows.Forms
程序集版本:4.0.0.0
Win32 版本:4.0.30319.34251 built by: FX452RTMGDR

基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System.Drawing
程序集版本:4.0.0.0
Win32 版本:4.0.30319.34209 built by: FX452RTMGDR

基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System
程序集版本:4.0.0.0
Win32 版本:4.0.30319.34238 built by: FX452RTMGDR

基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Configuration
程序集版本:4.0.0.0
Win32 版本:4.0.30319.34209 built by: FX452RTMGDR

基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Xml
程序集版本:4.0.0.0
Win32 版本:4.0.30319.34234 built by: FX452RTMGDR

基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

mscorlib.resources
程序集版本:4.0.0.0
Win32 版本:4.0.30319.18408 built by: FX451RTMGREL

基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/mscorlib.resources.dll

System.Windows.Forms.resources
程序集版本:4.0.0.0
Win32 版本:4.0.30319.18408 built by: FX451RTMGREL

基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/System.Windows.Forms.resources.dll

************** 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行

  • 写回答

5条回答

  • frank_20080215 2015-05-27 14:04
    关注

    图片像素太多了,换一张图片

    评论

报告相同问题?

悬赏问题

  • ¥15 MATLAB动图的问题
  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名