<?php
/* Create Imagick object */
$im = new Imagick( 'example.png' );
/* Create a drawing object and set the font size */
$draw = new ImagickDraw();
$draw->setFontSize( 30 );
/* Make the watermark semi-transparent */
$draw->setFillAlpha( 0.4 );
/* Set gravity to the center. More about gravity:
http://www.imagemagick.org/Usage/annotating/#gravity */
$draw->setGravity( Imagick::GRAVITY_CENTER );
/* Write the text on the image
Position x0,y0 (Because gravity is set to center)
Rotation 45 degrees.
*/
$im->annotateImage( $draw, 0, 0, 45, "Copyright Example" );
/* Output */
header( "Content-Type: image/{$im->getImageFormat()}" );
echo $im;
?>
|