【发布时间】:2012-08-01 12:33:46
【问题描述】:
我在多台计算机上运行 .NET 2.0 程序。在一个我有这个错误反复发生,直到我重置应用程序。
//line below was throwing the exception
this.myButton.BackgroundImage = global::myNamespace.Properties.Resources.myImage;
例外:
ExceptionType: ArgumentException
Message: Parameter is not valid.
Source: System.Drawing
StackTrace: at System.Drawing.Image.get_Flags()
at System.Windows.Forms.ControlPaint.IsImageTransparent(Image backgroundImage)
at System.Windows.Forms.Control.set_BackgroundImageLayout(ImageLayout value)
资源存在,重置后可以正常工作。任何人都可以提供任何关于可能发生的见解吗?
【问题讨论】:
-
可能是图片文件被什么东西锁住了?病毒扫描程序浮现在脑海中......
-
是的,同意...禁用杀毒软件
-
@CodingGorilla 如果我可以复制,我会尝试。
标签: c# winforms image exception-handling .net-2.0