The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Tk::Thumbnail - Create a grid of shrunken images.

SYNOPSIS

 $thumb = $parent->Thumbnail(-option => value, ... );

DESCRIPTION

Create a table of thumbnail images, having a default size of 32x32 pixels. Once we have a Photo of an image, shrink it by copying a subsample of the original to a blank Photo.

-images

A list of file names and/or Photo widgets. Thumbnail creates temporarty Photo images from all the files, and destroys them when the Thumbnail is destroyed or when a new list of images is specified in a subsequent configure call. Already existing Photos are left untouched.

-ilabels

A boolean, set to TRUE if you want file names displayed under the thumbnail images.

-font

The default font is fixed.

-iwidth

Pixel width of the thumbnails. Default is 32. The special value -1 means don't shrink images in the X direction.

-iheight

Pixel height of the thumbnails. Default is 32. The special value -1 means don't shrink images in the Y direction.

-command

A callback that's executed on a <Button-1> event over a thumbnail image. It's passed six arguments: the Label widget reference containing the thumbnail Photo image, the file name of the Photo, a boolean indicating whether or not the the Photo is valid, the Photo's pixel width and height, and a boolean indicating whether the image is a single frame (Tk::Photo) or has multiple frames (Tk::Animation).

A default callback is provided that simply displays the original image in a new Toplevel widget, along with a Get Info Button that opens another Toplevel containing information about the image. If the image has multiple frames, then QuickTime-like controller buttons are also presented to view the animation, and the left and right arrow keys single-step the animation frame-by-frame. The space bar toggles the play/pause button.

METHODS

$thumb->clear;

Destroys all Frames and Labels, and deletes all the temporary Photo images, in preparation for re-populating the Thumbnail with new data.

EXAMPLE

 $thumb = $mw->Thumbnail( -images => [ <images/*.ppm> ], -ilabels => 1 );

AUTHOR

sol0@Lehigh.EDU

Copyright (C) 2001 - 2004, Steve Lidie. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

KEYWORDS

thumbnail, image, QuickTime, Apple, photo, animation