tkimagewindow - Create and manipulate image widgets
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.
See the option manual entry for details on the standard options.
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:
Returns whether the image is a multi-frame GIF.
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).
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the configure command.
Clones the image of the widget given by pathName into the current widget.
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.
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.
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.
Returns the original height of the image.
Set the image for this widget given by the name imageName.
Display the specified image frame given with index. This command applies only to GIF images. The index starts with 0.
Specify the image of the current widget as a clone of the image frame given with pathName.
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.
Pause the animation.
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).
If boolean is true, no warning messages on stderr will be produced. Per default printing warning messages is enabled
Restarts the animation, starting with the first frame.
Resume the animation, this means the animation starts with the current frame. You may use this command to resume the animation after a pause.
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.
Returns whether the animation time has been changed.
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.
Starts the animation (at first frame).
Stops the animation.
Synchronize animation of cloned images with animation of origin image.
Returns the thumbnail height of the image.
Gives the size of the thumbnail. size should have the format <WIDTH>x<HEIGHT>.
Returns the thumbnail width of the image.
Returns the original width of the image.
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.
bitmap(n), image(n), options(n), photo(n)
animated gif, image, widget