I was wondering if there is a way to screenshot your desktop with a console application without having to call Windows.Forms and call the SendKeys
class.
Because I just created a compiler and it can only compile pure C# Console applications, it doesnt work if you add a reference because its going to throw you a few error See this link (My question with an answer on codeproject) and I want to create a console application which can take screenshots when I want it to.
I use this class to do my screenshots - see if it works for you. It doesn't reference forms and uses System.Drawing instead.
Here is an example using it in a ConsoleApp.
For anyone seeing this, I made a working example based on Cody Popham code (I cant comment) https://github.com/Wyulliam/screen-shooter
I added an option to set a path for the files and I'm using a timer to take multiples screenshots, so you can set, like 3000ms (3 seconds) and it will keep taking screen shots every 3 seconds.
I also used the Garbage Collector to don't explode our memories