home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
zkuste
/
Perl
/
ActivePerl-5.6.0.613.msi
/
䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥
/
_5af5405a0421b3931e189930a9e6aa39
< prev
next >
Wrap
Text File
|
2000-03-23
|
6KB
|
159 lines
<HTML>
<HEAD>
<TITLE>Tk::Image - Create and manipulate images</TITLE>
<LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
<LINK REV="made" HREF="mailto:">
</HEAD>
<BODY>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> Tk::Image - Create and manipulate images</P></STRONG>
</TD></TR>
</TABLE>
<A NAME="__index__"></A>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
<LI><A HREF="#synopsis">SYNOPSIS</A></LI>
<LI><A HREF="#description">DESCRIPTION</A></LI>
<LI><A HREF="#builtin image types">BUILT-IN IMAGE TYPES</A></LI>
<LI><A HREF="#see also">SEE ALSO</A></LI>
<LI><A HREF="#keywords">KEYWORDS</A></LI>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="name">NAME</A></H1>
<P>Tk::Image - Create and manipulate images</P>
<P>
<HR>
<H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
<UL>
<LI>Linux</LI>
<LI>Solaris</LI>
<LI>Windows</LI>
</UL>
<HR>
<H1><A NAME="synopsis">SYNOPSIS</A></H1>
<P><EM>$image</EM> = <EM>$widget</EM>-><EM>type</EM>(?<EM>arg arg ...</EM>?)</P>
<P><EM>$image</EM>-><EM>method</EM>(?<EM>arg arg ...</EM>?)</P>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P>The <STRONG>image</STRONG> constructors and methods are used to create, delete, and query images.
It can take several different forms, depending on the
<EM>type</EM>.</P>
<P>The constructors require a <EM>$widget</EM> to invoke them, this is used
to locate a <STRONG>MainWindow</STRONG>. (This is because the underlying Tk code
registers the images in the data structure for the <STRONG>MainWindow</STRONG>.)</P>
<P>The legal forms are:</P>
<DL>
<DT><STRONG><A NAME="item_type"><EM>$widget</EM>-><EM>type</EM>?(?<EM>name</EM>?,?<EM>option</EM>=><EM>value ...</EM>)?</A></STRONG><BR>
<DD>
Creates a new image and returns an object.
<EM>type</EM> specifies the type of the image, which must be one of
the types currently defined (e.g., <STRONG>Bitmap</STRONG>).
<EM>name</EM> specifies the name for the image; if it is omitted then
Tk picks a name of the form <STRONG>image</STRONG><EM>x</EM>, where <EM>x</EM> is
an integer.
There may be any number of <EM>option</EM>=><EM>value</EM> pairs,
which provide configuration options for the new image.
The legal set of options is defined separately for each image
type; see below for details on the options for built-in image types.
If an image already exists by the given name then it is replaced
with the new image and any instances of that image will redisplay
with the new contents.
<P></P>
<DT><STRONG><A NAME="item_delete"><EM>$image</EM>-><STRONG>delete</STRONG></A></STRONG><BR>
<DD>
Deletes the image <EM>$image</EM> and returns an empty string.
If there are instances of the image displayed in widgets,
the image won't actually be deleted until all of the instances
are released.
However, the association between the instances and the image
manager will be dropped.
Existing instances will retain their sizes but redisplay as
empty areas.
If a deleted image is recreated (with the same <EM>name</EM>)
the existing instances will use the new image.
<P></P>
<DT><STRONG><A NAME="item_height"><EM>$image</EM>-><STRONG>height</STRONG></A></STRONG><BR>
<DD>
Returns a decimal string giving the height of image <EM>name</EM>
in pixels.
<P></P>
<DT><STRONG><A NAME="item_imageNames"><EM>$widget</EM>-><STRONG>imageNames</STRONG></A></STRONG><BR>
<DD>
Returns a list containing all existing images for <EM>$widget</EM>'s
<STRONG>MainWindow</STRONG>.
<P></P>
<DT><STRONG><EM>$image</EM>-><STRONG>type</STRONG></STRONG><BR>
<DD>
Returns the type of <EM>$image</EM> (the value of the <EM>type</EM>
method when the image was created).
<P></P>
<DT><STRONG><A NAME="item_imageTypes"><EM>$widget</EM>-><STRONG>imageTypes</STRONG></A></STRONG><BR>
<DD>
Returns a list whose elements are all of the valid image types
(i.e., all of the values that may be supplied for the <EM>type</EM>
to create an image).
<P></P>
<DT><STRONG><A NAME="item_width"><EM>$image</EM>-><STRONG>width</STRONG></A></STRONG><BR>
<DD>
Returns a decimal string giving the width of image <EM>name</EM>
in pixels.
<P></P></DL>
<P>
<HR>
<H1><A NAME="builtin image types">BUILT-IN IMAGE TYPES</A></H1>
<P>The following image types are defined by Tk so they will be available
in any Tk application.
Individual applications or extensions may define additional types.</P>
<DL>
<DT><STRONG><A NAME="item_Bitmap"><STRONG>Bitmap</STRONG></A></STRONG><BR>
<DD>
Each pixel in the image displays a foreground color, a background
color, or nothing.
See <A HREF="../../../site/lib/Tk/Bitmap.html">the Tk::Bitmap manpage</A> for more information.
<P></P>
<DT><STRONG><A NAME="item_Pixmap"><STRONG>Pixmap</STRONG></A></STRONG><BR>
<DD>
<STRONG>Pixmap</STRONG> is slightly more general than <STRONG>Bitmap</STRONG>, each pixel can
be any available color or ``transparent'' (rendered as background color of the
widget image is displayed in). <STRONG>Pixmap</STRONG> is best used for icons and other
simple graphics with only a few colors.
<P><STRONG>Pixmap</STRONG> is derived from Tix. See <A HREF="../../../site/lib/Tk/Pixmap.html">the Tk::Pixmap manpage</A> for more information.</P>
<P></P>
<DT><STRONG><A NAME="item_Photo"><STRONG>Photo</STRONG></A></STRONG><BR>
<DD>
Displays a variety of full-color images, using dithering to
approximate colors on displays with limited color capabilities.
See <A HREF="../../../site/lib/Tk/Photo.html">the Tk::Photo manpage</A> documentation for more information.
<P></P></DL>
<P>
<HR>
<H1><A NAME="see also">SEE ALSO</A></H1>
<P><A HREF="../../../site/lib/Tk/Bitmap.html">Tk::Bitmap</A>
<A HREF="../../../site/lib/Tk/Pixmap.html">Tk::Pixmap</A>
<A HREF="../../../site/lib/Tk/Photo.html">Tk::Photo</A></P>
<P>
<HR>
<H1><A NAME="keywords">KEYWORDS</A></H1>
<P>height, image, types of images, width</P>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> Tk::Image - Create and manipulate images</P></STRONG>
</TD></TR>
</TABLE>
</BODY>
</HTML>