setFillColor(new ImagickPixel( "grey"">
当前位置:Gxlcms > PHP教程 > php函数imagick实现平铺整张图片的水印效果

php函数imagick实现平铺整张图片的水印效果

时间:2021-07-01 10:21:17 帮助过:157人阅读

  1. $image = new Imagick('logo.jpg');

  2. $im = new Imagick();

  3. $im->newImage( 140, 80, new ImagickPixel( "none" ) );
  4. $draw = new ImagickDraw();

  5. $draw->setFillColor(new ImagickPixel( "grey" ));

  6. $draw->setGravity(imagick::GRAVITY_NORTHWEST);
  7. $draw->annotation(10,10 ,'Copyright');
  8. $draw->setGravity(imagick::GRAVITY_SOUTHEAST);
  9. $draw->annotation(5,15 ,'Copyright');

  10. $im->drawImage( $draw);

  11. $image = $image->textureImage($im);
  12. $image->compositeImage($image,imagick::COMPOSITE_COPY,0,0);
  13. header( "Content-Type: image/{$image->getImageFormat()}" );

  14. $image->writeImage('wmark_text_tiled.jpg');

  15. $image->clear();
  16. $image->destroy();
  17. ?>

源图片: php函数imagick实现平铺整张图片的水印效果1

效果图: php函数imagick实现平铺整张图片的水印效果2

人气教程排行