
12. Images 75
Here are image manipulation methods common to the
remaining two image types:
$image->delete;
Deletes the image.
$image->height;
Returns pixel height of image.
$image->imageNames;
Returns a list of the names of all existing images.
$image->type;
Returns the type of image.
$image->imageTypes;
Returns a list of valid image types.
$image->width;
Returns pixel width of image.
When an image is created via the DefineBitmap, Bitmap,or
Photo method, Tk creates an image object reference to the
the image. For all image types, this object supports the cget
and configure methods in the same manner as widgets for
changing and querying configuration options. Of course,
image configuration commands can still be passed to the
creation method:
$image = $mw->Photo(-file => ‘/home/bug/photo.gif ’ );
The Bitmap Image Method
-background => color
Set background color for bitmap.
-data => string
Specify contents of bitmap in X11 bitmap format.
-file => pathName
Gives name of file whose contents define the bitmap in
X11 bitmap format.