downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<imagegrabscreenimageinterlace>
Last updated: Thu, 26 Jun 2008

imagegrabwindow

(PHP 5 >= 5.2.2)

imagegrabwindow — Captures a window

Description

resource imagegrabwindow ( int $window [, int $client_area ] )

Grabs a window or its client area using a windows handle (HWND property in COM instance)

Parameters

window

The HWND window ID

client_area

Include the client area of the application window

Return Values

Returns an image resource identifier on success, FALSE on failure.

Errors/Exceptions

E_NOTICE is issued if window_handle is invalid window handle. E_WARNING is issued if the Windows API is too old.

Examples

Example #1 imagegrabwindow() example

Capture a window (IE for example)

<?php
$browser
= new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$im = imagegrabwindow($handle);
$browser->Quit();
imagepng($im, "iesnap.png");
?>

Capture a window (IE for example) but with its content

<?php
$browser
= new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$browser->Navigate("http://www.libgd.org");

/* Still working? */
while ($browser->Busy) {
  
com_message_pump(4000);
}
$im = imagegrabwindow($handle, 0);
$browser->Quit();
imagepng($im, "iesnap.png");
?>

Notes

Note: This function is only available on Windows.



add a noteadd a note User Contributed Notes
Captures a window
There are no user contributed notes for this page.




<imagegrabscreenimageinterlace>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs