没有调试就开始错误:损坏的图像? [英] Start Without Debugging error: corruptimages?

查看:127
本文介绍了没有调试就开始错误:损坏的图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在编写一个C#Windows Forms应用程序,该应用程序在datagridview中显示很多图标.使用调试时,它可以正常工作.但是,当使用未经调试的启动时,它会为每个损坏"或不兼容"的图标显示一条错误消息(名为:.NET-BroadcastEventWindow.2.0 ...),这非常令人不安.以后可以正常工作.
有人可以告诉我如何解决它,或者是检测损坏的图像还是不兼容的图像,或者只是忽略错误消息:)?
谢谢

错误消息显示损坏的图像的路径. Windows Photo Gallery或Picasa无法打开它们.他们不知何故是真正的腐败.我需要检测它们或忽略错误(如调试器一样)以摆脱错误对话框.

Edit2:
其实我已经找到了答案.有些文件虽然是.ico文件,但其中包含多个图标(这就是照片库无法打开它们的原因).据我观察,这些只是同一图标的4到32位或中小型变体,由于某种原因,我的图标提取在它们上无法正常工作.有趣的是,"new Icon(path)"能够返回其中的一个图标,对于此应用程序来说已经足够了.

仍然令我感到困惑的是,如何以及在何处抛出该损坏的图像异常,为什么我无法捕捉到它?

Hello,
I am writing a C# Windows Forms application that displays lots of icons in a datagridview. It works correctly when debugging is used. However when start without debugging is used, it displays an error message (named: .NET-BroadcastEventWindow.2.0...) for each icon that is "corrupt" or "not compatible" which is very disturbing. It works fine later on.
Can someone tell how to solve it, either how to detect corrupt or not compatible images or just ignore the error messages :)?
Thanks

The error message shows the path of images that are corrupt. Windows Photo Gallery or Picasa cannot open them either. Somehow they are really corrupt. I need to detect them or ignore the errors (like debugger does) to get rid of error dialogs.


Actually I have found the answer. Some files contain more than 1 icons in it although they are .ico files (which is why photo gallery cannot open them). As far as I observed those are just 4 to 32-bit or small-middle-large sized variations of the same icon and for some reason my icon extraction does not work properly on them. What interesting is "new Icon(path)" is able to return one of the icons in it and it is enough good for this application.

What still confuses me is how and where that corrupt image exception is thrown, why I was not able to catch it? How does debugger catch and ignore it?

推荐答案

图像在调试模式下是否显示OK?他们为什么被腐败?它们来自哪里?
Do the images show OK in debug mode ? Why are they corrupted ? Where do they come from ?


哦,好.也许当您遍历它们时,您可以尝试将它们加载到您自己的代码中,以查看哪些已损坏?

您应该编辑您的帖子以添加详细信息,而不是发布确实是您更多问题的答案".
Oh, OK. Perhaps as you iterate over them you can try to load them in your own code to see which ones are corrupted ?

You should edit your post to add detail, not post an ''answer'' that''s really more of your question.


不显示通常的X(很好). Windows照片库也无法显示它们.我从注册表获取图像列表.我正在尝试在defaulticon键中显示所有图标.
No a usual X is displayed (which is fine). Windows Photo Gallery cannot display them either. I get the imagelist from registry. I am trying to display all the icons in defaulticon keys.


这篇关于没有调试就开始错误:损坏的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆