Debian Codegraph @

WinPhoto/WinPhoto.pm

raw
1 package Tk::WinPhoto;
2 require DynaLoader;
3
4 use vars qw($VERSION);
5 $VERSION = '4.005'; # $Id: //depot/Tkutf8/WinPhoto/WinPhoto.pm#4 $
6
7 use Tk qw($XS_VERSION);
8 require Tk::Image;
9 require Tk::Photo;
10
11 use base qw(DynaLoader);
12
13 bootstrap Tk::WinPhoto;
14
15 1;
16
17 __END__
18
19 =head1 NAME
20
21 Tk::WinPhoto - Load a Photo image from a window
22
23 =for category Experimental Modules
24
25 =head1 SYNOPSIS
26
27 use Tk;
28 use Tk::WinPhoto;
29
30 my $image = $mw->Photo(-format => 'Window', -data => oct($mw->id));
31 $image->write($path_name, -format => 'BMP|PPM|XPM');
32
33
34 =head1 DESCRIPTION
35
36 This is an extension for Tk800.* which will load a Photo image
37 from a snapshot of an X window specified by the -data option.
38
39 The window must exist and be visible. Because the code allows
40 you to capture windows not owned by Tk it does not attempt to
41 enforce this. If you are capturing one of Tk's windows then
42 use C<$w-E<gt>update>.
43
44 If window is mapped, but obscured by other windows then what is captured is the
45 rectangle the window would occupy. This can be considered a feature.
46 For Tk-owned windows C<$w-E<gt>raise> can used to bring window forward.
47
48 Once the Photo is loaded it can be saved using
49 C<$image-E<gt>write(-format =E<gt> ...)> using any of formats which support
50 writing.
51
52 =head1 AUTHOR
53
54 Nick Ing-Simmons E<lt>[email protected]<gt>
55
56 =cut
57