Chris's coding blog

Automated browser screenshot capture

March 18, 2009

BrowserCapture.exe.zip
Project source (Visual Studio 2008)

This small windows forms application does the following:

  • Opens a website you specify in Internet Explorer, Firefox, Safari and Opera.
  • Resizes the window to the size you set.
  • Takes a screengrab of each one.
  • Optionally closes each browser.

You can specify the browser paths and path to save the screenshots (which are saved in PNG format) to.

The screenshot mechanism is courtesy a class from of this article. The remaining code is some straight forward windows enumeration via the winapi and PostMessage.

csharpwinforms

Chris Small

I'm Chris Small, a software engineer working in London. This is my tech blog. Find out more about me via GithubStackoverflowResume