Screen Capture w/ Dual Monitors

P

Patrick

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?
 
F

Floyd Burger

Bitmap MyImage = new Bitmap(Screen.AllScreens[1].Bounds.Width,
Screen.AllScreens[1].Bounds.Height, g1);

that should do it
 

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