Jouke has asked for the wisdom of the Perl Monks concerning the following question:
this snippet of code is executed within a loop (that's why the @images exists)...$images[$y] = $mainframe->Photo(-file => "$file.gif"); my ($height, $width) = ($images[$y]->height, $images[$y]->widt +h); my $yfactor = $height/$MAX_HEIGHT; my $xfactor = $width/$MAX_WIDTH; my $scalefactor = $xfactor > $yfactor ? int($xfactor) : int($y +factor); $scalefactor +=1; my $scaledimage = $mainframe->Photo("button$y"); $scaledimage->copy($images[$y], -subsample => $scalefactor); $images[$y]->destroy();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(ichimunki) re: Resizing images && Tk
by ichimunki (Priest) on Mar 14, 2001 at 03:42 UTC | |
|
Re: Resizing images && Tk
by archon (Monk) on Mar 14, 2001 at 03:39 UTC | |
by Jouke (Curate) on Mar 14, 2001 at 15:03 UTC | |
|
Re: Resizing images && Tk
by Jouke (Curate) on Mar 14, 2001 at 17:32 UTC |