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

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 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘