php截屏代码

  1. <?php
  2. $browser = new COM("InternetExplorer.Application");
  3. $handle = $browser->HWND;
  4. $browser->Visible = true;
  5. $browser->Navigate("http://www.phpfensi.com");
  6. /* Still working? */
  7. while ($browser->Busy) {
  8. com_message_pump(4000);
  9. }
  10. $im = imagegrabwindow($handle, 0);
  11. $browser->Quit();
  12. imagepng($im, "iesnap.png");
  13. ?>