Writes an image to the specified filename. If the filename parameter is NULL, the image is written to the filename set by Imagick::ReadImage() or Imagick::SetImageFilename().

<?
# text of annotation
$text = "DJ Mike";
# path to font
$font = "../../fonts/lokicola.ttf";
$fontsize = 100;
$fontcolor = "#ffff88";
# output file name
$file = "banner.gif";
# moves text down
$offset = 14;
# make a black pallete
$pallete = new Imagick;
$pallete->newimage(375,140, "#000000");
# set pallet format to gif
$pallete->setimageformat("gif");
# make a draw object with settings
$draw = new imagickdraw();
$draw->setgravity(imagick::GRAVITY_CENTER); # center text
$draw->setfont("$font"); # set font
$draw->setfontsize($fontsize); # set font size
$draw->setfillcolor("$fontcolor"); # set font color
$pallete->annotateImage ( $draw,0 ,$offset, 0, $text ); # annotate image, offset moves text down
# write file
$pallete->writeimage( "$file");
# redirect browser to image
header("Location:banner.gif");
?>
|
|
|