Imager-Screenshot
view release on metacpan or search on metacpan
Screenshot.pm view on Meta::CPAN
=back
=head1 TAGS
screenshot() sets a number of tags in the images it returns, these are:
=over
=item *
ss_left - the distance between the left side of the window and the
left side of the captured area. The same value as the I<left>
parameter when that is positive.
=item *
ss_top - the distance between the top side of the window the top side
of the captured area. The same value at the I<top> parameter when
that is positive.
=item *
ss_window_width - the full width of the window.
=item *
ss_window_height - the full height of the window.
=item *
ss_type - the type of capture done, either "Win32" or "X11".
=back
To cheaply get the window size you can capture a single pixel:
my $im = screenshot(right => 1, bottom => 1);
my $window_width = $im->tags(name => 'ss_window_width');
my $window_height = $im->tags(name => 'ss_window_height');
=head1 CAVEATS
It's possible to have more than one grab driver available, for
example, Win32 and X11, and which is used can have an effect on the
result.
Under Win32 or OS X, if there's a screesaver running, then you grab
the results of the screensaver.
On OS X, you can grab the display from an ssh session as long as the
ssh session is under the same user as the currently active user on the
display.
Grabbing the root window on a rootless server (eg. Cygwin/X) may not
grab the background that you see. In fact, when I tested under
Cygwin/X I got the xterm window contents even when the Windows
screensaver was running. The root window captured appeared to be that
generated by my window manager.
Grabbing a window with other windows overlaying it will capture the
content of those windows where they hide the window you want to
capture. You may want to raise the window to top. This may be a
security concern if the overlapping windows contain any sensitive
information - true for any screen capture.
=head1 LICENSE
Imager::Screenshot is licensed under the same terms as Perl itself.
=head1 TODO
Future plans include:
=over
=item *
window name searches - currently screenshot() requires a window
identifier of some sort, it would be more usable if we could supply
some other identifier, either a window title or a window class name.
=back
=head1 AUTHOR
Tony Cook <tonyc@cpan.org>
=cut
( run in 0.551 second using v1.01-cache-2.11-cpan-7fcb06a456a )