summaryrefslogtreecommitdiffstats
path: root/doc/photo.n
diff options
context:
space:
mode:
Diffstat (limited to 'doc/photo.n')
-rw-r--r--doc/photo.n27
1 files changed, 20 insertions, 7 deletions
diff --git a/doc/photo.n b/doc/photo.n
index bd49def..48c99ae 100644
--- a/doc/photo.n
+++ b/doc/photo.n
@@ -9,7 +9,7 @@
'\" Department of Computer Science,
'\" Australian National University.
'\"
-'\" RCS: @(#) $Id: photo.n,v 1.14.2.3 2003/07/17 22:55:27 dkf Exp $
+'\" RCS: @(#) $Id: photo.n,v 1.14.2.4 2004/10/28 12:25:22 dkf Exp $
'\"
.so man.macros
.TH photo n 4.0 Tk "Tk Built-In Commands"
@@ -36,7 +36,6 @@ in regions where no image data has been supplied
or where it has been set transparent by the \fBtransparency set\fR
subcommand.
.VE 8.4
-
.SH "CREATING PHOTOS"
.PP
Like all images, photos are created using the \fBimage create\fR
@@ -93,7 +92,6 @@ Specifies the width of the image, in pixels. This option is useful
primarily in situations where the user wishes to build up the contents
of the image piece by piece. A value of zero (the default) allows the
image to expand or shrink horizontally to fit the data stored in it.
-
.SH "IMAGE COMMAND"
.PP
When a photo image is created, Tk also creates a new command
@@ -216,7 +214,7 @@ the specified color.
\fB\-format\fI format-name\fR
Specifies the name of the image file format handler to be used.
Specifically, this subcommand searches
-for the first handler whose name matches a initial substring of
+for the first handler whose name matches an initial substring of
\fIformat-name\fR and which has the capability to read this image data.
If this option is not given, this subcommand uses the first
handler that has the capability to read the image data.
@@ -347,7 +345,7 @@ the specified color.
\fB\-format\fI format-name\fR
Specifies the name of the image file format handler to be used to
write the data to the file. Specifically, this subcommand searches
-for the first handler whose name matches a initial substring of
+for the first handler whose name matches an initial substring of
\fIformat-name\fR and which has the capability to write an image
file. If this option is not given, this subcommand uses the first
handler that has the capability to write an image file.
@@ -397,7 +395,6 @@ to use of the formats supported by the handler.
Note that not all image handlers may support writing transparency data
to a file, even where the target image format does.
.VE 8.4
-
.SH "COLOR ALLOCATION"
.PP
When a photo image is displayed in a window, the photo image code
@@ -427,12 +424,28 @@ each primary color to try to allocate. It can also be used to force
the image to be displayed in shades of gray, even on a color display,
by giving a single number rather than three numbers separated by
slashes.
-
.SH CREDITS
.PP
The photo image type was designed and implemented by Paul Mackerras,
based on his earlier photo widget and some suggestions from
John Ousterhout.
+.SH EXAMPLE
+Load an image from a file and tile it to the size of a window, which
+is useful for producing a tiled background:
+.CS
+# These lines should be called once
+\fBimage create photo\fR untiled -file "theFile.ppm"
+\fBimage create photo\fR tiled
+
+# These lines should be called whenever .someWidget changes
+# size; a <Configure> binding is useful here
+set width [winfo width .someWidget]
+set height [winfo height .someWidget]
+tiled \fBcopy\fR untiled \-to 0 0 $width $height \-shrink
+.CE
+
+.SH "SEE ALSO"
+image(n)
.SH KEYWORDS
photo, image, color