By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,243 Members | 1,079 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,243 IT Pros & Developers. It's quick & easy.

Screenshot From Dual Monitors

P: n/a
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?

Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Take a look at:

http://www.syncfusion.com/FAQ/WinFor..._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

"Patrick" <NA@NA.com> wrote in message
news:c9***********@spnode25.nerdc.ufl.edu...
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?

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.