To get a snapshot of a HTML page, a window or a complete screen was always something tricky to do in PHP. For one of my current projects, I had to check that our changes did not affect visually any page. An easy way to achieve this goal is to compare the rendered pages in the browsers itself, easy and time consuming (for a human being :D).
That's why I finally sit down and implemented imagegrabscreen and imagegrabwindow . They capture respectively the whole screen or a window (using its handle).
He includes a few examples including grabbing a default screenshot, grabbing just the contents of a certain application (like Internet Explorer), and grabbing a fullscreened IE window too.