请检查我的imagemagick代码,其中我试图添加“大小”变量,但没有得到我们需要添加大小变量的地方就像“颜色”,“字符串”......
$animation = new Imagick();
$animation->setFormat( "gif" );
$color = new ImagickPixel( "blue" );
$color->setColor( "red" );
$string = "kothi!";
$draw = new ImagickDraw();
$draw->setFont( "arial.ttf" );
for ( $i =0; $i <= 0; $i++ )
{
$part = substr( $string,100, $i);
$animation->newImage( 100, 50, $color);
$animation->annotateImage( $draw, 100, 100, 100, $part );
$animation->setImageDelay( 30 );
}
$draw->setFont( "arial.ttf" );
$animation->newImage( 100, 50, $color);
$animation->annotateImage( $draw, 10, 10, 0, $string );
$animation->setImageDelay( 120 );
header( "Content-Type: image/gif" );
echo $animation->getImagesBlob();
答案 0 :(得分:0)
bool Imagick::setSize ( int $columns , int $rows )
设置Imagick对象的大小。在读取RGB,GRAY或CMYK等原始图像格式之前设置它。
- php.net