Tk::WinPhoto - Load a Photo image from a window
use Tk; use Tk::WinPhoto; my $image = $mw->Photo(-format => 'Window', -data => oct($mw->id)); $image->write($path_name, -format => 'BMP|PPM|XPM');
WinPhoto(3) perl/Tk Documentation WinPhoto(3) NAME Tk::WinPhoto - Load a Photo image from a window SYNOPSIS use Tk; use Tk::WinPhoto; my $image = $mw->Photo(-format => 'Window', -data => oct($mw->id)); $image->write($path_name, -format => 'BMP|PPM|XPM'); DESCRIPTION This is an extension for Tk800.* which will load a Photo image from a snapshot of an X window specified by the -data option. The window must exist and be visible. Because the code allows you to capture windows not owned by Tk it does not attempt to enforce this. If you are capturing one of Tk's windows then use "$w->update". If window is mapped, but obscured by other windows then what is captured is the rectangle the window would occupy. This can be considered a feature. For Tk-owned windows "$w->raise" can used to bring window forward. Once the Photo is loaded it can be saved using "$image->write(-format => ...)" using any of formats which support writing. AUTHOR Nick Ing-Simmons <nick@ni-s.u-net.com> ATTRIBUTES See attributes(7) for descriptions of the following attributes: +---------------+----------------------------+ |ATTRIBUTE TYPE | ATTRIBUTE VALUE | +---------------+----------------------------+ |Availability | library/perl-5/perl-tk-532 | +---------------+----------------------------+ |Stability | Volatile | +---------------+----------------------------+ NOTES Source code for open source software components in Oracle Solaris can be found at https://www.oracle.com/downloads/opensource/solaris-source- code-downloads.html. This software was built from source available at https://github.com/oracle/solaris-userland. The original community source was downloaded from http://search.cpan.org/CPAN/authors/id/S/SR/SREZIC/Tk-804.036.tar.gz. Further information about this software can be found on the open source community website at http://search.cpan.org/~srezic/Tk. Tk804.036 2013-11-15 WinPhoto(3)