image operation [arg arg...]

Create and manipulate image objects. The image command can take the following forms:

image create type [name] [option value...]

Create a new image of type type and return its name. The currently supported image types are bitmap and photo. The option-value pairs valid for these types are described in the individual sections that follow. The name returned will be name if given; otherwise, Tk picks a unique name of the form imageN. If an image already exists by the given name, it is replaced with the new image and any instances of that image will be redisplayed.

A new Tcl command is created with the image’s name. This command supports the cget and configure operation for changing and querying the image’s configuration options in the same manner as for widgets.

image delete image [image...]

Delete each of the given images. If a widget is using an instance of an image, it won’t actually be deleted until all of the instances are released. Existing instances will redisplay as empty areas. If a deleted image is recreated, the existing instances will use the new image.

image height image

Return the height, in pixels, of the image image.

image names

Return a list of all existing images.

image type image

Return the type of the image image.

image types

Return a list of supported image types.

image width image

Return the width, in pixels, of image image.

Bitmap Images

A bitmap image is represented by a background color, a foreground color, and two X11-format bitmaps, called ...

Get Tcl/Tk in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.