How to take screenshots of WPF applications in correct size and content

Posted by Thomas W. on Super User See other posts from Super User or by Thomas W.
Published on 2014-06-02T13:59:15Z Indexed on 2014/06/02 15:34 UTC
Read the original article Hit count: 278

Filed under:
|

I usually take screenshots of single windows via the built-in key combination Alt+Print. Unfortunately this does not work well for more and more applications - all of them are WPF applications.

Usually the screen shots have at least one of the following properties:

  • the screenshot is larger than expected and contains parts of the screen around the actual window

  • the screenshot has the correct size but includes parts of other windows, e.g. the Windows task bar. Of course the task bar might be in front of the window, but taking screen shots of "normal" programs works fine.

How do I take screenshots of WPF application which are correct in size and content?

I'd like to avoid the extra effort of checking all the screenshots for correctness, reproducing the situation, taking them again in case of issues or repairing/faking them manually in any pixel manipulation program (e.g. Paint.NET).

I observe this on Windows 7 x64 SP 1, all official updates installed, but it might apply to other Windows versions as well (not tested yet). .NET 4.5 is installed. The application itself might only need the built-in .NET 3.5.1.

It's reproducible on a virtual machine with the same settings.

Examples:

Screenshot of an application running in maximized mode. The screen shot includes parts of the task bar.

Screenshot 1 - maximized application showing task bar

Screenshot of a progress dialog which is behind the task bar. The screenshot also includes the task bar, while it doesn't for non WPF applications.

Screenshot 2 - progress bar behind the task bar

© Super User or respective owner

Related posts about Windows

Related posts about screenshot