Reverting revision 328792.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@328793 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Sherif Ramadan 2012-12-16 19:50:12 +00:00
parent 5c79820b1b
commit d26b8d1332

View file

@ -209,64 +209,6 @@ $im->writeImages("example_small.gif", true);
</programlisting>
</example>
</para>
<para>
Working with ellipse primitive and custom fonts
<example>
<title>Create a PHP logo</title>
<programlisting role="php">
<![CDATA[
<?php
/* Set width and height in proportion of genuine PHP logo */
$width = 400;
$height = 210;
/* Create an Imagick object with transparent canvas */
$img = new Imagick();
$img->newImage($width, $height, new ImagickPixel('transparent'));
/* New ImagickDraw instance for ellipse draw */
$draw = new ImagickDraw();
/* Set purple fill color for ellipse */
$draw->setFillColor('#777bb4');
/* Set ellipse dimensions */
$draw->ellipse($width / 2, $height / 2, $width / 2, $height / 2, 0, 360);
/* Draw ellipse onto the canvas */
$img->drawImage($draw);
/* Reset fill color from purple to black for text (note: we are reusing ImagickDraw object) */
$draw->setFillColor('black');
/* Set stroke border to white color */
$draw->setStrokeColor('white');
/* Set stroke border thickness */
$draw->setStrokeWidth(2);
/* Set font kerning (negative value means that letters are closer to each other) */
$draw->setTextKerning(-8);
/* Set font and font size used in PHP logo */
$draw->setFont('Handel Gothic.ttf');
$draw->setFontSize(150);
/* Center text horizontally and vertically */
$draw->setGravity(Imagick::GRAVITY_CENTER);
/* Add center "php" with Y offset of -10 to canvas (inside ellipse) */
$img->annotateImage($draw, 0, -10, 0, 'php');
$img->setImageFormat('png');
/* Set appropriate header for PNG and output the image */
header('Content-Type: image/png');
echo $img;
?>
]]>
</programlisting>
&example.outputs.similar;
<mediaobject>
<alt>Output of example : Creating PHP logo with Imagick</alt>
<imageobject>
<imagedata fileref="en/reference/imagick/figures/php_logo.png"/>
</imageobject>
</mediaobject>
</example>
</para>
</section>
</chapter>