Screenshot From Dual Monitors

P

Patrick

I need some code for getting screenshots from the secondary monitor on dual
monitor display.

Here's a bit of the code for a screen from the primary monitor.

Bitmap MyImage = new Bitmap(Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height, g1);

For the second monitor I can use the Screen.Allscreens method to get and
array of the screens. So far that is looking like this...

Screen[] screens = Screen.Allscreen;

I'm not 100% on that syntax since I don't have the code infront of me but
you get the idea..

Now from that array how do I access the second monitor. I've been successful
in getting dimensions and such like 'screens[1].Bounds.width' or
screen[1].Displayname but I don't know how to get the screen shot via
somthing like...

Bitmap MyImage = new Bitmap(Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height, g1);

in the above PrimaryScreen lets the program know to use the primay display,
how do I reference the second monitor?
 
G

Guest

Take a look at:

http://www.syncfusion.com/FAQ/WinForms/FAQ_c3c.asp#q870q

On how to get a screenshot of a form.

I believe you can use similar technique but I'm pretty sure it's got to be
done in unmanaged code. Basically, instead of doing the capture of the
device context for the form, you'd be doing it against the:

GetWindowDC(GetDesktopWindow())

Both of those are Windows GDI calls.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top