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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With