Found that a piece of code in the class does not work, although all the libraries are connected. Attached screenshots:
What could be the problem?
Found that a piece of code in the class does not work, although all the libraries are connected. Attached screenshots:
What could be the problem?
Error due to mismatch of method names and namespace properties.
Rename the method and the error will go away.
This is probably not recursion, but simply in the namespace, the Screen class and your Screen method have the same name. And IDE can not understand what you had there lead. Always, before posting a question, hover over a mistake and read what is written there, maybe just a typo.
class Class1 { public void CreateScreen() { Graphics graph = null; Bitmap bmp = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height); graph = Graphics.FromImage(bmp); graph.CopyFromScreen(0, 0, 0, 0, bmp.Size); bmp.Save("filename.png"); } } Good luck in programming!
SeeSharp
Program , and in Class there is user321409Source: https://ru.stackoverflow.com/questions/924547/
All Articles