tkimagewindow(n) 1.0 tkimagewindow "Tk Commands"

Name

tkimagewindow - Create and manipulate image widgets

Table Of Contents

Synopsis

Description

tk::imagewindow pathName ?options?

The tk::imagewindow command creates a new window (given by the pathName argument) and makes it into an imagewindow widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the imagewindow such as its background color and relief. The tk::imagewindow command returns the path name of the new window. At the time this command is invoked, there must not exist a window named pathName, but pathName's parent must exist.

An imagewindow is a widget which displays images. This includes the display of animated GIF images.

STANDARD OPTIONS

-background
-borderwidth
-cursor
-relief

See the option manual entry for details on the standard options.

WIDGET SPECIFIC OPTIONS

Command-Line Switch: -height
Database Name: height
Database Class: Height

Specifies the desired height for the window in any of the forms acceptable to Tk_GetPixels. If this option is less than or equal to zero then the window will not request any size at all.

Command-Line Switch: -padx
Database Name:
Database Class:

Specifies the desired padding of the image relative to the left and right border of the window. This option accepts any of the forms acceptable to Tk_GetPixels.

Command-Line Switch: -pady
Database Name:
Database Class:

Specifies the desired padding of the image relative to the top and bottom border of the window. This option accepts any of the forms acceptable to Tk_GetPixels.

Command-Line Switch: -width
Database Name: width
Database Class: Width

Specifies the desired width for the window in any of the forms acceptable to Tk_GetPixels. If this option is less than or equal to zero then the window will not request any size at all.

WIDGET COMMAND

The tk::imagewindow command creates a new Tcl command whose name is the same as the path name of the imagewindow's window. This command may be used to invoke various operations on the widget. It has the following general form:

pathName option ?arg arg ...?

PathName is the name of the command, which is the same as the imagewindow widget's path name. Option and the args determine the exact behavior of the command. The following commands are possible for imagewindow widgets:

pathName animated?

Returns whether the image is a multi-frame GIF.

pathName background boolean

Boolean determines whether the widget should use the background color given in the GIF image. If arg is false, then the user defined background color is used (this is the default).

pathName cget option

Returns the current value of the configuration option given by option. Option may have any of the values accepted by the configure command.

pathName clone pathName

Clones the image of the widget given by pathName into the current widget.

pathName configure ?option? ?value option value ...?

Query or modify the configuration options of the widget. If no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. Option may have any of the values accepted by the imagewindow command.

pathName data imageData

Specifies the contents of the image as a string. The string imageData should contain base64-encoded data. The format of the string must be one of those for which there is an image file format handler that will accept string data.

pathName file fileName

fileName gives the name of a file that is to be read to supply data for the image. The file format must be one of those for which there is an image file format handler that can read data.

pathName height

Returns the original height of the image.

pathName image imageName

Set the image for this widget given by the name imageName.

pathName index index

Display the specified image frame given with index. This command applies only to GIF images. The index starts with 0.

pathName isclone pathName

Specify the image of the current widget as a clone of the image frame given with pathName.

pathName mindelay ?mindelay?

If no argument is given the minimal delay time will be returned. Otherwise this command manipulates the animation time. The minimum delay is given with mindelay, that means the delay time between two frames will not be less than mindelay.

pathName pause

Pause the animation.

pathName preserve boolean

If boolean is true, the origin image will be preserved. If set to false, the origin image will not be preserved. This may save memory space if set to true (the default is false).

pathName quite boolean

If boolean is true, no warning messages on stderr will be produced. Per default printing warning messages is enabled

pathName restart

Restarts the animation, starting with the first frame.

pathName resume

Resume the animation, this means the animation starts with the current frame. You may use this command to resume the animation after a pause.

pathName save filename

Save all changes of the animation time to the file given with filename. The file name is required because it is likely that the file name of the image has changed in the meanwhile. The save fails if the file given with filename does not have the same file size as the original image file - this is a minimal safety check because this command is not writing a new file, it is overwriting the values of the given file.

pathName save?

Returns whether the animation time has been changed.

pathName slowdown ?floatValue?

If no argument is given the slow down factor will be returned. Otherwise this command will be used to slow down the animation time with the factor given by floatValue. But if the factor is less than 1.0 the animation time will be faster.

pathName start

Starts the animation (at first frame).

pathName stop

Stops the animation.

pathName sync

Synchronize animation of cloned images with animation of origin image.

pathName thumbheight

Returns the thumbnail height of the image.

pathName thumbsize size

Gives the size of the thumbnail. size should have the format <WIDTH>x<HEIGHT>.

pathName thumbwidth

Returns the thumbnail width of the image.

pathName width

Returns the original width of the image.

ANIMATION

Note that animation of animated GIFs will not be started automatically, you have to use the command start. If an image widget with active animation becomes unmapped the animation stops, and restarts (at the first frame) if the widget becomes mapped. If an image window becomes unvisible the animation will pause until the widget is visible again.

See Also

bitmap(n), image(n), options(n), photo(n)

Keywords

animated gif, image, widget