.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "WinPhoto 3pm" .TH WinPhoto 3pm 2024-03-07 Tk804.036 "perl/Tk Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Tk::WinPhoto \- Load a Photo image from a window .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& use Tk; \& use Tk::WinPhoto; \& \& my $image = $mw\->Photo(\-format => \*(AqWindow\*(Aq, \-data => oct($mw\->id)); \& $image\->write($path_name, \-format => \*(AqBMP|PPM|XPM\*(Aq); .Ve .SH DESCRIPTION .IX Header "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. .PP 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 \f(CW\*(C`$w\->update\*(C'\fR. .PP 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 \f(CW\*(C`$w\->raise\*(C'\fR can used to bring window forward. .PP Once the Photo is loaded it can be saved using \&\f(CW\*(C`$image\->write(\-format => ...)\*(C'\fR using any of formats which support writing. .SH AUTHOR .IX Header "AUTHOR" Nick Ing-Simmons