Creating an image
Before you can display a graphic in Tk, you must first create a Tk image. To accomplish this, Tk provides the image
command. This command allows you to create, delete, and query the keywords for any of the supported image types. The built-in image types are bitmap (two color graphics) and photo. The photo types as shipped in the base distribution are PPM/PGM and GIF.
Based on the keyword used the image command takes several syntactic forms. The syntax and keywords are as follows:
image keyword path
Keyword |
Interpretation |
---|---|
|
Creates an image and a command with the same name. |
|
Deletes the named image. |
|
Returns a decimal string containing the height of the image in pixels. |
|
Returns a Boolean value indicating if the named image provided is currently in use. |
|
Returns a list containing the names of all created images. |
|
Returns the type of image as referenced by name. |
|
Returns a lost containing all valid image types... |