didou           Thu Nov  6 05:58:47 2003 EDT

  Modified files:              
    /phpdoc/en/reference/image/functions        imagepolygon.xml 
  Log:
  ading an example
  
Index: phpdoc/en/reference/image/functions/imagepolygon.xml
diff -u phpdoc/en/reference/image/functions/imagepolygon.xml:1.5 
phpdoc/en/reference/image/functions/imagepolygon.xml:1.6
--- phpdoc/en/reference/image/functions/imagepolygon.xml:1.5    Wed Feb 12 12:49:07 
2003
+++ phpdoc/en/reference/image/functions/imagepolygon.xml        Thu Nov  6 05:58:47 
2003
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.5 $ -->
+<!-- $Revision: 1.6 $ -->
 <!-- splitted from ./en/functions/image.xml, last change in rev 1.2 -->
   <refentry id="function.imagepolygon">
    <refnamediv>
@@ -21,6 +21,40 @@
      polygon's vertices, ie. points[0] = x0, points[1] = y0, points[2]
      = x1, points[3] = y1, etc.  <parameter>num_points</parameter> is
      the total number of points (vertices).
+    </para>
+    <para>
+     <example>
+      <title><function>imagepolygon</function> example</title>
+      <programlisting role="php">
+<![CDATA[
+<?php
+// create a blank image
+$image = imagecreate(400,300);
+
+// fill the background color
+$bg = imagecolorallocate($image,0,0,0);
+
+// choose a color for the polygon
+$col_poly = imagecolorallocate($image,255,255,255);
+
+// draw the polygon
+imagepolygon($image, 
+             array (
+                    0, 0,
+                    100, 200,
+                    300, 200
+             ),
+             3,
+             $col_poly);
+
+// output the picture
+header("Content-type: image/png");
+imagepng($image);
+
+?>
+]]>
+      </programlisting>
+     </example>
     </para>
     <para>
      See also <function>imagecreate</function> and

Reply via email to