Tk-StyledButton
view release on metacpan or search on metacpan
lib/Tk/StyledButton.pm view on Meta::CPAN
}
if ($style eq 'image') {
#
# create from an image; r, g, b are xscale, yscale, and the image,
# respectively
#
my $format = $b->cget('-format');
my $data = $b->data(-format => $format);
my $bgimg = ($format eq 'GIF') ? GD::Image->newFromGif($data) :
($format eq 'PNG') ? GD::Image->newFromPng($data) :
GD::Image->newFromJpeg($data); # ($format eq 'JPEG')
if (($r == 1) && ($g == 1)) {
$btnimg->copy($bgimg, 2, 2, 0, 0, $bgimg->width, $bgimg->height);
}
else {
$btnimg->copyResampled($bgimg, 2, 2, 0, 0,
$btnimg->width - 2, $btnimg->height - 2,
$bgimg->width, $bgimg->height);
}
( run in 0.358 second using v1.01-cache-2.11-cpan-0a6323c29d9 )