16

I need to capture a screenshot of the scrolling window's client area, using .NET. My first priority is capturing web page screenshots. But this can be not the only one use case. For example it can be also a text area in the Notepad.

Some applications (FastStone Capture, PicPick) can emulate user behavior to reach hidden part of a scrollable area and capture it. I'm looking for something like this or recommendations for alternative way to get the same result.

alt text

Alex Musayev
  • 635
  • 10
  • 20
  • 4
    +1 for including explanatory graphics. –  Oct 09 '10 at 21:04
  • did you get any solution on this one ? I'm looking for a general solution that works for any scroll enabled window. – Daniel Bogdan Feb 22 '15 at 10:21
  • 1
    I found a solution to capture web pages http://stackoverflow.com/a/3904596/177194 There is also WatiN is out there: http://watin.org I don't think it's possible to use common approach to scroll absolutely any window on Windows due there are a lot of software based on non-native/custom runtimes. Most browsers and Java apps will require individual solutions. – Alex Musayev Feb 22 '15 at 10:54

3 Answers3

3

You can get windows to redirect a WM_PAINT to an offscreen buffer with WM_PRINT and WM_PRINTCLIENT. This is better than screenscraping because it makes sure that obscured parts of a window(behind other windows) is painted anyway. If your target window scrolls by scrolling a child window position, WM_PRINT should apply. Just maybe it also helps your scenario.

2

I've continued my search and founded IECapt, — an open source tool which can take a web page screenshot using IE inside of it. It has С++ and .NET versions. Also there are Qt/WebKit-based analog from the same author: http://cutycapt.sourceforge.net.

This tools is not a direct answer for my question, but both of them solve the original problem by 90%.

Alex Musayev
  • 635
  • 10
  • 20
1

Have you looked at Snagit? http://www.techsmith.com/download/accessories/default.asp

Also, here's a c# utility that seems to do what you're asking for: http://www.codeproject.com/KB/graphics/IECapture.aspx

morganpdx
  • 1,856
  • 2
  • 29
  • 46