Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c# screen capture virtual desktop

I've found a way to create virtual desktops with c#. Now I was wondering if we can take a screenshot of a particular desktop and if so how ?

Thanks in advance

Blizz


2 Answers

HAve you tried the CopyFromScreen method in the GFX Object

        Graphics g = new Graphics();
        g.CopyFromScreen(  ....params.... )
like image 165
Eoin Campbell Avatar answered Mar 16 '26 11:03

Eoin Campbell


I haven't tried it but the first thing I'd try is:

  • create a new thread
  • switch the thread to the new desktop by calling SetThreadDesktop
  • take a screen shot
  • switch thread back

might just work.

like image 40
Ben Schwehn Avatar answered Mar 16 '26 11:03

Ben Schwehn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!