Hello, I need to take a screenshot that includes parts not on screen.
Image of what i need: https://drive.google.com/file/d/0B5AXiesUBkuxdVg5NnA0Y2ktcEU/view?usp=sharing
The screenshot must be able to be taken at any size.
Thank you, for your feedback.
Wim SturkenboomPosted Nov 20, 2014, 1:43 AM
I've found a work-around (it's not perfect). Assuming this is Windows, you need to make Windows think that the screen resolution is bigger than it actually is; I used the approach as described here: http://superuser.com/questions/62051/is-there-a-way-to-fake-a-dual-second-monitor. I assume that this requires a second videocard in your computer but I'm not sure. In my case, it's the video-out of my laptop.
[quote]
- Right click on the desktop, click 'Screen Resolution'
- Click 'Detect' on the next screen
- Click 'Another display not detected' and under the multiple displays option select 'Try to connect anyway on: VGA'
- Click 'Apply'
- You can now enable your desktop to be extended as if you have a second screen plugged into your computer.
[/quote]And next I took a 'standard' code for screenshots (example copied from http://stackoverflow.com/questions/15847637/take-screenshot-from-multiple-desktops-of-all-visible-applications-and-forms)
private void button1_Click(object sender, EventArgs e)
{
int screenLeft = SystemInformation.VirtualScreen.Left;
int screenTop = SystemInformation.VirtualScreen.Top;
int screenWidth = SystemInformation.VirtualScreen.Width;
int screenHeight = SystemInformation.VirtualScreen.Height;
using (Bitmap bmp = new Bitmap(screenWidth, screenHeight))
{
using (Graphics g = Graphics.FromImage(bmp))
{
g.CopyFromScreen(screenLeft, screenTop, 0, 0, bmp.Size);
}
bmp.Save("c:\\dump.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
}
}
The resolution of the laptop is 1280x800; after adding the second (VGA) display, it went to 2304x800 but the VGA is only 768 heigh (so you will be missing a little there.
Disadvantage is that your mouse might move into the 'second monitor' and looks like it is gone. Also, if you're not careful, you might manage to move applications nearly completely onto the second monitor and have difficulty to drag them back.
Other disadvantage is the limitation of the VGA monitor (1024x768) so if you're running a 2048x1536 monitor, you might see a huge black area under the VGA section.
While researching, I stumbled upon http://http://virtualmonitor.github.io/. It might be worth some investigation.
Attached screenshot:
The Visual Studio window takes up the full screen of the laptop.
The browser has been moved partially onto the second monitor.
K AndrewsPosted Nov 20, 2014, 9:22 AM
I have thought of a work around that will work for any needed size. Getting all the open windows, and using PrintWindow() to draw them to bitmaps. Using the window's z-order i can put all the bitmaps on one bitmap. Because PrintWindow() works if the window is not on the screen, the windows could be 1000s of pixels off the real screen and still draw. I could also add in a normal screenshot under the drawn windows.
Wim SturkenboomPosted Nov 20, 2014, 1:56 AM
- It seems to be possible to change the resolution of the VGA monitor to (at least) match the resolution of the laptop screen; so the earlier mentioned disadvantage of the black section might not apply in all cases.
- I have no idea how to 'undo' the second monitor, so I'll have to live with disappearing mouse pointers :( Maybe a registry edit will do.
Good luck// Edit
I seem to have found the solution for '2'; windows seems to think the second display is a projector. Windows-key + P and choose computer only.