PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

imagegrabwindow> <imagegif
Last updated: Fri, 27 Jun 2008

view this page in

imagegrabscreen

(PHP 5 >= 5.2.2)

imagegrabscreen — Captures the whole screen

Description

resource imagegrabscreen ( void )

Grabs a screenshot of the whole screen.

Return Values

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

Examples

Example #1 imagegrabscreen() example

This example demonstrates how to take a screenshot of the current screen and save it as a png image.

<?php
$im 
imagegrabscreen();
imagepng($im"myscreenshot.png");
?>

Notes

Note: This function is only available on Windows.



add a note add a note User Contributed Notes
imagegrabscreen
andrew at local dot co dot nz
19-Apr-2008 12:02
For this to work your Apache service must be set to 'Allow service to interact with desktop' otherwise you will just get a blank image. To fix this right-click My Computer, select Manage/Services and Applications/Services - find the apache service (like Apache2) and right-click, select Properties - choose the Log on tab and check the 'Allow service to interact with desktop' checkbox. Restart Apache.

imagegrabwindow> <imagegif
Last updated: Fri, 27 Jun 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites