"参数无效"从System.Drawing.Graphics.GetHdc()抛出该异常 - 仅适用于某些机 [英] "Parameter is not valid" Thrown from System.Drawing.Graphics.GetHdc()-- Only on Some Machines
问题描述
我遇到这个错误参数无效,它是从
I encountered this error "Parameter is not valid", and it is thrown from
System.Drawing.Graphics.GetHdc()
奇怪的是,它只是抛出一台机器上这个错误,但不能在其他机器。
The weird thing is that it is only thrown this error on one machine, but not on other machines.
对不起,是模糊的,你有一个可以解决这个问题的任何想法?
Sorry for being vague, any idea you have that can solve this problem?
推荐答案
请参阅这是否适用于你?
参数不有效
See if this applies to you? Parameter is not valid
您会发现您的问题是由GDI泄漏引起的。打开
任务管理器,如果进程选项卡没有一个GDI对象
列然后通过视图菜单中添加它。然后,你应该看到,GDI
对象不断增长,直到最后你的应用程序倒下。一旦你
添加DeleteDC()调用,你应该看到GDI对象保持
相当稳定。
You'll find that your problem is caused by a GDI leak. Open up TaskManager and if the Processes Tab does not have a GDI objects column then add it via the View menu. You should then see that the GDI Objects keep growing until eventually your app falls over. Once you add the DeleteDC() call you should see that the GDI Objects stays fairly constant.
这篇关于"参数无效"从System.Drawing.Graphics.GetHdc()抛出该异常 - 仅适用于某些机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!