perl中打开一个png文件并把图片赋值给$im,如何做?

2025-04-29 12:53:19
推荐回答(2个)
回答1:

#!/usr/bin/perl
use Image::Magick;
my($image, $x);
$image = Image::Magick->new;
$x = $image->Read('girl.png', 'logo.png', 'rose.png');
warn "$x" if "$x";

$x = $image->Crop(geometry=>'100x100+100+100');
warn "$x" if "$x";

$x = $image->Write('x.png');
warn "$x" if "$x";

回答2:

$im={local $/=undef;}