Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / lib / site_perl / 5.8.0 / sun4-solaris / Tk / Image.pod
CommitLineData
86530b38
AT
1# Copyright (c) 1994 The Regents of the University of California.
2# Copyright (c) 1994-1996 Sun Microsystems, Inc.
3# See the file "license.terms" for information on usage and redistribution
4# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
5#
6#
7
8=head1 NAME
9
10Tk::Image - Create and manipulate images
11
12=for category Tk Image Classes
13
14=head1 SYNOPSIS
15
16I<$image> = I<$widget>-E<gt>I<type>(?I<arg arg ...>?)
17
18I<$image>-E<gt>I<method>(?I<arg arg ...>?)
19
20=head1 DESCRIPTION
21
22The B<image> constructors and methods are used to create, delete, and query images.
23It can take several different forms, depending on the
24I<type>.
25
26The constructors require a I<$widget> to invoke them, this is used
27to locate a B<MainWindow>. (This is because the underlying Tk code
28registers the images in the data structure for the B<MainWindow>.)
29
30The legal forms are:
31
32=over 4
33
34=item I<$widget>-E<gt>I<type>?(?I<name>?,?I<option>=E<gt>I<value ...>)?
35
36Creates a new image and returns an object.
37I<type> specifies the type of the image, which must be one of
38the types currently defined (e.g., B<Bitmap>).
39I<name> specifies the name for the image; if it is omitted then
40Tk picks a name of the form B<image>I<x>, where I<x> is
41an integer.
42There may be any number of I<option>=E<gt>I<value> pairs,
43which provide configuration options for the new image.
44The legal set of options is defined separately for each image
45type; see below for details on the options for built-in image types.
46If an image already exists by the given name then it is replaced
47with the new image and any instances of that image will redisplay
48with the new contents.
49
50=item I<$image>-E<gt>B<delete>
51
52Deletes the image I<$image> and returns an empty string.
53If there are instances of the image displayed in widgets,
54the image won't actually be deleted until all of the instances
55are released.
56However, the association between the instances and the image
57manager will be dropped.
58Existing instances will retain their sizes but redisplay as
59empty areas.
60If a deleted image is recreated (with the same I<name>)
61the existing instances will use the new image.
62
63=item I<$image>-E<gt>B<height>
64
65Returns a decimal string giving the height of image I<name>
66in pixels.
67
68=item I<$widget>-E<gt>B<imageNames>
69
70Returns a list containing all existing images for I<$widget>'s
71B<MainWindow>.
72
73=item I<$image>-E<gt>B<type>
74
75Returns the type of I<$image> (the value of the I<type>
76method when the image was created).
77
78=item I<$widget>-E<gt>B<imageTypes>
79
80Returns a list whose elements are all of the valid image types
81(i.e., all of the values that may be supplied for the I<type>
82to create an image).
83
84=item I<$image>-E<gt>B<width>
85
86Returns a decimal string giving the width of image I<name>
87in pixels.
88
89=back
90
91=head1 BUILT-IN IMAGE TYPES
92
93The following image types are defined by Tk so they will be available
94in any Tk application.
95Individual applications or extensions may define additional types.
96
97=over 4
98
99=item B<Bitmap>
100
101Each pixel in the image displays a foreground color, a background
102color, or nothing.
103See L<Tk::Bitmap> for more information.
104
105=item B<Pixmap>
106
107B<Pixmap> is slightly more general than B<Bitmap>, each pixel can
108be any available color or "transparent" (rendered as background color of the
109widget image is displayed in). B<Pixmap> is best used for icons and other
110simple graphics with only a few colors.
111
112B<Pixmap> is derived from Tix. See L<Tk::Pixmap> for more information.
113
114=item B<Photo>
115
116Displays a variety of full-color images, using dithering to
117approximate colors on displays with limited color capabilities.
118See L<Tk::Photo> documentation for more information.
119
120=back
121
122=head1 SEE ALSO
123
124L<Tk::Bitmap|Tk::Bitmap>
125L<Tk::Pixmap|Tk::Pixmap>
126L<Tk::Photo|Tk::Photo>
127
128=head1 KEYWORDS
129
130height, image, types of images, width
131
132=cut
133