cvs: phpdoc /en/reference/image/functions imagefilledpolygon.xml
| From: | Aidan Lister | Date: | Sun, 10 Oct 2004 11:06:36 +0000 |
| Subject: | cvs: phpdoc /en/reference/image/functions imagefilledpolygon.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969364475@lists.php.net to get a copy of this message | ||
aidan Sun Oct 10 07:06:36 2004 EDT
Modified files:
/phpdoc/en/reference/image/functions imagefilledpolygon.xml
Log:
Less ridiculous example
http://cvs.php.net/diff.php/phpdoc/en/reference/image/functions/imagefilledpolygon.xml?r1=1.6&r2=1.7&ty=u
Index: phpdoc/en/reference/image/functions/imagefilledpolygon.xml
diff -u phpdoc/en/reference/image/functions/imagefilledpolygon.xml:1.6
phpdoc/en/reference/image/functions/imagefilledpolygon.xml:1.7
--- phpdoc/en/reference/image/functions/imagefilledpolygon.xml:1.6 Wed Dec 17 09:32:29 2003
+++ phpdoc/en/reference/image/functions/imagefilledpolygon.xml Sun Oct 10 07:06:35 2004
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.6 $ -->
+<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/image.xml, last change in rev 1.2 -->
<refentry id="function.imagefilledpolygon">
<refnamediv>
@@ -18,10 +18,15 @@
<para>
<function>imagefilledpolygon</function> creates a filled polygon
in image <parameter>image</parameter>.
- <parameter>points</parameter> is a PHP array containing the
- polygon's vertices, i.e. points[0] = x0, points[1] = y0, points[2]
- = x1, points[3] = y1, etc. <parameter>num_points</parameter> is
- the total number of vertices.
+ </para>
+ <para>
+ <parameter>points</parameter> is an array containing the
+ <literal>x</literal> and <literal>y</literal> co-ordinates
+ of the polygons vertices consecutively.
+ </para>
+ <para>
+ The parameter <parameter>num_points</parameter> is the total
+ number of vertices, which must be larger than 3.
</para>
<para>
<example>
@@ -29,40 +34,30 @@
<programlisting role="php">
<![CDATA[
<?php
-
-// this example is provided by ecofarm at mullum dot com dot au
-
// set up array of points for polygon
$values = array(
- 0 => 40, // x1
- 1 => 50, // y1
- 2 => 20, // x2
- 3 => 240, // y2
- 4 => 60, // x3
- 5 => 60, // y3
- 6 => 240, // x4
- 7 => 20, // y4
- 8 => 50, // x5
- 9 => 40, // y5
- 10 => 10, // x6
- 11 => 10, // y6
-);
+ 40, 50, // Point 1 (x, y)
+ 20, 240, // Point 2 (x, y)
+ 60, 60, // Point 3 (x, y)
+ 240, 20, // Point 4 (x, y)
+ 50, 40, // Point 5 (x, y)
+ 10, 10 // Point 6 (x, y)
+ );
// create image
-$im = imagecreate(250, 250);
+$image = imagecreate(250, 250);
// some colors
-$bg = imagecolorallocate($im, 255, 255, 255);
-$blue = imagecolorallocate($im, 0, 0, 255);
+$bg = imagecolorallocate($image, 200, 200, 200);
+$blue = imagecolorallocate($image, 0, 0, 255);
// draw a polygon
-imagefilledpolygon($im, $values, 6, $blue );
+imagefilledpolygon($image, $values, 6, $blue);
// flush image
header('Content-type: image/png');
-imagepng($im);
-imagedestroy($im);
-
+imagepng($image);
+imagedestroy($image);
?>
]]>
</programlisting>