imagegrabwindow() and imagegrabscreen()

July 13th, 2007
No Gravatar

I stumbled over these two new functions in the PHP CVS today. They are only available in Windows as they use COM, but interesting non the least.

imagegrabwindow — Captures a window
resource imagegrabwindow ( int $window [, int $client_area] )

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

imagegrabscreen — Captures the whole screen
resource imagegrabscreen ( void )

Grabs a screenshot of the whole screen.

See the manual pages for examples.

Update: Pierre discusses it on his blog aswell.

Bookmark it del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Propeller | Yahoo


Was this post useful to you? Let me know, buy me a beer!
Alternatively, if you're feeling impecunious, you may like to subscribe to my RSS feed, or see other articles in the PHP category.

One Response to “imagegrabwindow() and imagegrabscreen()”

  1. PierreNo Gravatar Says:

    Hi!

    The functions do not use COM, only my examples as it is one of the only way to actually control an application on Windows from a standard PHP install :-)

    The functions use the win32 API to fetch the bitmap of a given window or screen.

Leave a Reply