I'm struggling to get my head around the techniques involved and am trying to adapt the original MagickWand example. Here's the code I have so far:
Code: Select all
<?php
$font_file = '100.ttf';
$photo_file = 'test.eps';
$magick_wand=NewMagickWand();
MagickSetFormat($magick_wand, 'eps');
MagickReadImage($magick_wand,$photo_file);
$drawing_wand=NewDrawingWand();
DrawSetFont($drawing_wand,"$font_file");
DrawSetFontSize($drawing_wand,100);
DrawSetGravity($drawing_wand,MW_CenterGravity);
$pixel_wand=NewPixelWand();
PixelSetColor($pixel_wand,"#c0c0c0");
DrawSetFillColor($drawing_wand,$pixel_wand);
if (!IsDrawingWand($drawing_wand)) echo "\$drawing_wand is not a DrawingWand resource";
if (MagickAnnotateImage($magick_wand,$drawing_wand,0,0,0,"Rose") != 0) {
header('Content-type: image/eps');
header('Content-Disposition: attachment; filename="vector_test.eps"');
MagickEchoImageBlob( $magick_wand );
} else {
echo "Exception: " . MagickGetExceptionString($magick_wand);
}
?>
Thanks in advance.