-
-
$image = new Imagick('logo.jpg');
$im = new Imagick();
- $im->newImage( 140, 80, new ImagickPixel( "none" ) );
- $draw = new ImagickDraw();
$draw->setFillColor(new ImagickPixel( "grey" ));
- $draw->setGravity(imagick::GRAVITY_NORTHWEST);
- $draw->annotation(10,10 ,'Copyright');
- $draw->setGravity(imagick::GRAVITY_SOUTHEAST);
- $draw->annotation(5,15 ,'Copyright');
$im->drawImage( $draw);
- $image = $image->textureImage($im);
- $image->compositeImage($image,imagick::COMPOSITE_COPY,0,0);
- header( "Content-Type: image/{$image->getImageFormat()}" );
$image->writeImage('wmark_text_tiled.jpg');
- $image->clear();
- $image->destroy();
- ?>
-
复制代码
源图片:
效果图:
|