cvs: phpdoc /en/reference/image/functions exif-read-data.xml gd-info.xml getimagesize.xml image-type-to-mime-type.xml image2wbmp.xml imagechar.xml
imagecharup.xml imagecolorallocate.xml imagecolorclosestalpha.xml imagecolorsforindex.xml imagecreatefromgif.xml imagecreatefromjpeg.xml
imagecreatefrompng.xml imagecreatefromwbmp.xml imagefilledarc.xml imagefilledellipse.xml imagefilledpolygon.xml

From: Date: Fri, 15 Aug 2003 22:50:50 +0000
Subject: cvs: phpdoc /en/reference/image/functions exif-read-data.xml gd-info.xml getimagesize.xml image-type-to-mime-type.xml image2wbmp.xml imagechar.xml
imagecharup.xml imagecolorallocate.xml imagecolorclosestalpha.xml imagecolorsforindex.xml imagecreatefromgif.xml imagecreatefromjpeg.xml
imagecreatefrompng.xml imagecreatefromwbmp.xml imagefilledarc.xml imagefilledellipse.xml imagefilledpolygon.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969355805@lists.php.net to get a copy of this message
didou Fri Aug 15 18:50:50 2003 EDT Modified files: /phpdoc/en/reference/image/functions exif-read-data.xml gd-info.xml getimagesize.xml image-type-to-mime-type.xml image2wbmp.xml imagechar.xml imagecharup.xml imagecolorallocate.xml imagecolorclosestalpha.xml imagecolorsforindex.xml imagecreatefromgif.xml imagecreatefromjpeg.xml imagecreatefrompng.xml imagecreatefromwbmp.xml imagefilledarc.xml imagefilledellipse.xml imagefilledpolygon.xml Log: integrating users notes adding examples obfuscating vic's email adding documentation to image_type_to_mime_type

Index: phpdoc/en/reference/image/functions/exif-read-data.xml diff -u phpdoc/en/reference/image/functions/exif-read-data.xml:1.8 phpdoc/en/reference/image/functions/exif-read-data.xml:1.9 --- phpdoc/en/reference/image/functions/exif-read-data.xml:1.8 Mon Jun 9 15:26:05 2003 +++ phpdoc/en/reference/image/functions/exif-read-data.xml Fri Aug 15 18:50:50 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <!-- splitted from ./en/functions/image.xml, last change in rev 1.78 --> <refentry id="function.exif-read-data"> <refnamediv> @@ -89,6 +89,11 @@ cameras, but unfortunately each digital camera maker has a different idea of how to actually tag their images, so you can't always rely on a specific Exif header being present. + </para> + <para> + Windows ME/XP both can wipe the Exif headers when connecting to a camera. + More information available at <ulink + url="&url.winexif;">&url.winexif;</ulink>. </para> </note> <para> Index: phpdoc/en/reference/image/functions/gd-info.xml diff -u phpdoc/en/reference/image/functions/gd-info.xml:1.3 phpdoc/en/reference/image/functions/gd-info.xml:1.4 --- phpdoc/en/reference/image/functions/gd-info.xml:1.3 Sat Jan 18 12:16:16 2003 +++ phpdoc/en/reference/image/functions/gd-info.xml Fri Aug 15 18:50:50 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id='function.gd-info'> <refnamediv> <refname>gd_info</refname> @@ -92,10 +92,14 @@ <![CDATA[ <?php var_dump(gd_info()); - -/* Typical Output - ============== - +?> +]]> + </programlisting> + <para> + The typical output is : + </para> + <screen> +<![CDATA[ array(9) { ["GD Version"]=> string(24) "bundled (2.0 compatible)" @@ -116,15 +120,12 @@ ["XBM Support"]=> bool(false) } - -*/ -?> ]]> - </programlisting> + </screen> </example> </para> <simpara> - See also: <function>imagepng</function>, + See also <function>imagepng</function>, <function>imagejpeg</function>, <function>imagegif</function>, <function>imagewbmp</function>, and Index: phpdoc/en/reference/image/functions/getimagesize.xml diff -u phpdoc/en/reference/image/functions/getimagesize.xml:1.18 phpdoc/en/reference/image/functions/getimagesize.xml:1.19 --- phpdoc/en/reference/image/functions/getimagesize.xml:1.18 Mon Aug 4 04:58:38 2003 +++ phpdoc/en/reference/image/functions/getimagesize.xml Fri Aug 15 18:50:50 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.18 $ --> +<!-- $Revision: 1.19 $ --> <!-- splitted from ./en/functions/image.xml, last change in rev 1.36 --> <refentry id="function.getimagesize"> <refnamediv> @@ -62,7 +62,11 @@ <programlisting role="php"> <![CDATA[ <?php -$size = getimagesize ("http://www.example.com/gifs/logo.gif"); +$size = getimagesize("http://www.example.com/gifs/logo.gif"); + +// if the file name has space in it, encode it properly +$size = getimagesize("http://www.example.com/gifs/lo%20go.gif"); + ?> ]]> </programlisting> Index: phpdoc/en/reference/image/functions/image-type-to-mime-type.xml diff -u phpdoc/en/reference/image/functions/image-type-to-mime-type.xml:1.1 phpdoc/en/reference/image/functions/image-type-to-mime-type.xml:1.2 --- phpdoc/en/reference/image/functions/image-type-to-mime-type.xml:1.1 Fri Nov 29 14:24:59 2002 +++ phpdoc/en/reference/image/functions/image-type-to-mime-type.xml Fri Aug 15 18:50:50 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- splitted from ./en/functions/image.xml, last change in rev 1.36 --> <refentry id="function.image-type-to-mime-type"> <refnamediv> @@ -28,16 +28,99 @@ </example> </para> <para> + The returned values are as follows + <table> + <title>Returned values Constants</title> + <tgroup cols="2"> + <thead> + <row> + <entry><parameter>imagetype</parameter></entry> + <entry>Returned value</entry> + </row> + </thead> + <tbody> + <row> + <entry><constant>IMAGETYPE_GIF</constant></entry> + <entry><literal>image/gif</literal></entry> + </row> + <row> + <entry><constant>IMAGETYPE_JPEG</constant></entry> + <entry><literal>image/jpeg</literal></entry> + </row> + <row> + <entry><constant>IMAGETYPE_PNG</constant></entry> + <entry><literal>image/png</literal></entry> + </row> + <row> + <entry><constant>IMAGETYPE_SWF</constant></entry> + <entry><literal>application/x-shockwave-flash</literal></entry> + </row> + <row> + <entry><constant>IMAGETYPE_PSD</constant></entry> + <entry><literal>image/psd</literal></entry> + </row> + <row> + <entry><constant>IMAGETYPE_BMP</constant></entry> + <entry><literal>image/bmp</literal></entry> + </row> + <row> + <entry><constant>IMAGETYPE_TIFF_II</constant> (intel byte order)</entry> + <entry><literal>image/tiff</literal></entry> + </row> + <row> + <entry> + <constant>IMAGETYPE_TIFF_MM</constant> (motorola byte order) + </entry> + <entry><literal>image/tiff</literal></entry> + </row> + <row> + <entry><constant>IMAGETYPE_JPC</constant></entry> + <entry><literal>application/octet-stream</literal></entry> + </row> + <row> + <entry><constant>IMAGETYPE_JP2</constant></entry> + <entry><literal>image/jp2</literal></entry> + </row> + <row> + <entry><constant>IMAGETYPE_JPX</constant></entry> + <entry><literal>application/octet-stream</literal></entry> + </row> + <row> + <entry><constant>IMAGETYPE_JB2</constant></entry> + <entry><literal>application/octet-stream</literal></entry> + </row> + <row> + <entry><constant>IMAGETYPE_SWC</constant></entry> + <entry><literal>application/x-shockwave-flash</literal></entry> + </row> + <row> + <entry><constant>IMAGETYPE_IFF</constant></entry> + <entry><literal>image/iff</literal></entry> + </row> + <row> + <entry><constant>IMAGETYPE_WBMP</constant></entry> + <entry><literal>image/vnd.wap.wbmp</literal></entry> + </row> + <row> + <entry><constant>IMAGETYPE_XBM</constant></entry> + <entry><literal>image/xbm</literal></entry> + </row> + </tbody> + </tgroup> + </table> + </para> + <para> <note> <simpara> This function does not require the GD image library. </simpara> - <simpara> - See also <function>getimagesize</function>, - <function>exif_imagetype</function>, <function>exif_read_data</function> - and <function>exif_thumbnail</function>. - </simpara> </note> + </para> + <para> + See also <function>getimagesize</function>, + <function>exif_imagetype</function>, + <function>exif_read_data</function> and + <function>exif_thumbnail</function>. </para> </refsect1> </refentry> Index: phpdoc/en/reference/image/functions/image2wbmp.xml diff -u phpdoc/en/reference/image/functions/image2wbmp.xml:1.3 phpdoc/en/reference/image/functions/image2wbmp.xml:1.4 --- phpdoc/en/reference/image/functions/image2wbmp.xml:1.3 Thu Apr 18 13:13:09 2002 +++ phpdoc/en/reference/image/functions/image2wbmp.xml Fri Aug 15 18:50:50 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- splitted from ./en/functions/image.xml, last change in rev 1.61 --> <refentry id="function.image2wbmp"> <refnamediv> @@ -26,6 +26,23 @@ By sending an <acronym>image/vnd.wap.wbmp</acronym> content-type using <function>header</function>, you can create a PHP script that outputs WBMP images directly. + </para> + <para> + <example> + <title><function>image2wbmp</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$file = 'php.jpg'; + +header('Content-type: ' . image_type_to_mime(IMAGETYPE_WBMP)); +image2wbmp($file); // output the stream directly + +?> +]]> + </programlisting> + </example> </para> <note> <para> Index: phpdoc/en/reference/image/functions/imagechar.xml diff -u phpdoc/en/reference/image/functions/imagechar.xml:1.4 phpdoc/en/reference/image/functions/imagechar.xml:1.5 --- phpdoc/en/reference/image/functions/imagechar.xml:1.4 Wed Feb 12 12:49:07 2003 +++ phpdoc/en/reference/image/functions/imagechar.xml Fri Aug 15 18:50:50 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/image.xml, last change in rev 1.36 --> <refentry id="function.imagechar"> <refnamediv> @@ -27,7 +27,33 @@ corresponding to larger fonts). </para> <para> - See also <function>imageloadfont</function>. + <example> + <title><function>imagechar</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$im = imagecreate(100,100); + +$string = 'PHP'; + +$bg = imagecolorallocate($im, 255, 255, 255); +$black = imagecolorallocate($im, 0, 0, 0); + +// prints a black "P" in the top left corner +imagechar($im, 1, 0, 0, $string, $black); + +header('Content-type: image/png'); +imagepng($im); + +?> +]]> + </programlisting> + </example> + </para> + <para> + See also <function>imagecharup</function> and + <function>imageloadfont</function>. </para> </refsect1> </refentry> Index: phpdoc/en/reference/image/functions/imagecharup.xml diff -u phpdoc/en/reference/image/functions/imagecharup.xml:1.4 phpdoc/en/reference/image/functions/imagecharup.xml:1.5 --- phpdoc/en/reference/image/functions/imagecharup.xml:1.4 Wed Feb 12 12:49:07 2003 +++ phpdoc/en/reference/image/functions/imagecharup.xml Fri Aug 15 18:50:50 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/image.xml, last change in rev 1.36 --> <refentry id="function.imagecharup"> <refnamediv> @@ -27,7 +27,33 @@ used. </para> <para> - See also <function>imageloadfont</function>. + <example> + <title><function>imagecharup</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$im = imagecreate(100,100); + +$string = 'Note that the first letter is a N'; + +$bg = imagecolorallocate($im, 255, 255, 255); +$black = imagecolorallocate($im, 0, 0, 0); + +// prints a black "Z" on a white background +imagecharup($im, 3, 10, 10, $string, $black); + +header('Content-type: image/png'); +imagepng($im); + +?> +]]> + </programlisting> + </example> + </para> + <para> + See also <function>imagechar</function> and + <function>imageloadfont</function>. </para> </refsect1> </refentry> Index: phpdoc/en/reference/image/functions/imagecolorallocate.xml diff -u phpdoc/en/reference/image/functions/imagecolorallocate.xml:1.5 phpdoc/en/reference/image/functions/imagecolorallocate.xml:1.6 --- phpdoc/en/reference/image/functions/imagecolorallocate.xml:1.5 Wed Jul 16 13:14:17 2003 +++ phpdoc/en/reference/image/functions/imagecolorallocate.xml Fri Aug 15 18:50:50 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.36 --> <refentry id="function.imagecolorallocate"> <refnamediv> @@ -23,16 +23,34 @@ function. <parameter>red</parameter>, <parameter>green</parameter> and <parameter>blue</parameter> are the values of the red, green and blue component of the requested color respectively. These parameters are - integers between 0 and 255. + integers between 0 and 255 or hexadecimals between 0x00 and 0xFF. <function>imagecolorallocate</function> must be called to create each color that is to be used in the image represented by <parameter>image</parameter>. + </para> + <note> + <para> + The first call to <function>imagecolorallocate</function> fills + the background color. + </para> + </note> + <para> <informalexample> <programlisting role="php"> <![CDATA[ <?php -$white = imagecolorallocate ($im, 255, 255, 255); -$black = imagecolorallocate ($im, 0, 0, 0); + +// sets background to red +$background = imagecolorallocate($im, 255, 0, 0); + +// sets some colors +$white = imagecolorallocate($im, 255, 255, 255); +$black = imagecolorallocate($im, 0, 0, 0); + +// hexadecimal way +$white = imagecolorallocate($im, 0xFF, 0xFF, 0xFF); +$black = imagecolorallocate($im, 0x00, 0x00, 0x00); + ?> ]]> </programlisting> Index: phpdoc/en/reference/image/functions/imagecolorclosestalpha.xml diff -u phpdoc/en/reference/image/functions/imagecolorclosestalpha.xml:1.3 phpdoc/en/reference/image/functions/imagecolorclosestalpha.xml:1.4 --- phpdoc/en/reference/image/functions/imagecolorclosestalpha.xml:1.3 Thu Apr 18 13:13:09 2002 +++ phpdoc/en/reference/image/functions/imagecolorclosestalpha.xml Fri Aug 15 18:50:50 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- splitted from ./en/functions/image.xml, last change in rev 1.36 --> <refentry id="function.imagecolorclosestalpha"> <refnamediv> @@ -20,10 +20,14 @@ Returns the index of the color in the palette of the image which is "closest" to the specified <acronym>RGB</acronym> value and <parameter>alpha</parameter> level. </para> + <note> + <para> + This function was added in PHP 4.0.6 and requires GD 2.0.1 + </para> + </note> <para> See also <function>imagecolorexactalpha</function>. </para> - <note><para>This function was added in PHP 4.0.6 and requires GD 2.0.1</para></note> </refsect1> </refentry> Index: phpdoc/en/reference/image/functions/imagecolorsforindex.xml diff -u phpdoc/en/reference/image/functions/imagecolorsforindex.xml:1.3 phpdoc/en/reference/image/functions/imagecolorsforindex.xml:1.4 --- phpdoc/en/reference/image/functions/imagecolorsforindex.xml:1.3 Thu Apr 18 13:13:09 2002 +++ phpdoc/en/reference/image/functions/imagecolorsforindex.xml Fri Aug 15 18:50:50 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- splitted from ./en/functions/image.xml, last change in rev 1.36 --> <refentry id="function.imagecolorsforindex"> <refnamediv> @@ -14,10 +14,52 @@ <methodparam><type>int</type><parameter>index</parameter></methodparam> </methodsynopsis> <para> - This returns an associative array with red, green, and blue keys - that contain the appropriate values for the specified color + This returns an associative array with red, green, blue and alpha + keys that contain the appropriate values for the specified color index. </para> + <para> + <example> + <title><function>imagecolorsforindex</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// open an image +$im = imagecreatefrompng('nexen.png'); + +// get a color +$start_x = 40; +$start_y = 50; +$color_index = imagecolorat($im, $start_x, $start_y); + +// make it human readable +$color_tran = imagecolorsforindex($im, $color_index); + +// what is it ? +echo '<pre>'; +print_r($color_tran); +echo '</pre>'; + +?> +]]> + </programlisting> + <para> + This example will output : + </para> + <screen> +<![CDATA[ +Array +( + [red] => 226 + [green] => 222 + [blue] => 252 + [alpha] => 0 +) +]]> + </screen> + </example> + </para> <para> See also <function>imagecolorat</function> and <function>imagecolorexact</function>. Index: phpdoc/en/reference/image/functions/imagecreatefromgif.xml diff -u phpdoc/en/reference/image/functions/imagecreatefromgif.xml:1.7 phpdoc/en/reference/image/functions/imagecreatefromgif.xml:1.8 --- phpdoc/en/reference/image/functions/imagecreatefromgif.xml:1.7 Wed Jul 16 13:14:17 2003 +++ phpdoc/en/reference/image/functions/imagecreatefromgif.xml Fri Aug 15 18:50:50 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <!-- splitted from ./en/functions/image.xml, last change in rev 1.2 --> <refentry id="function.imagecreatefromgif"> <refnamediv> @@ -24,7 +24,7 @@ <example> <title> Example to handle an error during creation (courtesy - vic@zymsys.com) + vic at zymsys dot com) </title> <programlisting role="php"> <![CDATA[ Index: phpdoc/en/reference/image/functions/imagecreatefromjpeg.xml diff -u phpdoc/en/reference/image/functions/imagecreatefromjpeg.xml:1.5 phpdoc/en/reference/image/functions/imagecreatefromjpeg.xml:1.6 --- phpdoc/en/reference/image/functions/imagecreatefromjpeg.xml:1.5 Wed Jul 16 13:14:17 2003 +++ phpdoc/en/reference/image/functions/imagecreatefromjpeg.xml Fri Aug 15 18:50:50 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.4 --> <refentry id="function.imagecreatefromjpeg"> <refnamediv> @@ -24,7 +24,7 @@ <example> <title> Example to handle an error during creation (courtesy - vic@zymsys.com ) + vic at zymsys dot com ) </title> <programlisting role="php"> <![CDATA[ Index: phpdoc/en/reference/image/functions/imagecreatefrompng.xml diff -u phpdoc/en/reference/image/functions/imagecreatefrompng.xml:1.5 phpdoc/en/reference/image/functions/imagecreatefrompng.xml:1.6 --- phpdoc/en/reference/image/functions/imagecreatefrompng.xml:1.5 Wed Jul 16 13:14:17 2003 +++ phpdoc/en/reference/image/functions/imagecreatefrompng.xml Fri Aug 15 18:50:50 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.4 --> <refentry id="function.imagecreatefrompng"> <refnamediv> @@ -24,7 +24,7 @@ <example> <title> Example to handle an error during creation (courtesy - vic@zymsys.com) + vic at zymsys dot com) </title> <programlisting role="php"> <![CDATA[ Index: phpdoc/en/reference/image/functions/imagecreatefromwbmp.xml diff -u phpdoc/en/reference/image/functions/imagecreatefromwbmp.xml:1.5 phpdoc/en/reference/image/functions/imagecreatefromwbmp.xml:1.6 --- phpdoc/en/reference/image/functions/imagecreatefromwbmp.xml:1.5 Wed Jul 16 13:14:17 2003 +++ phpdoc/en/reference/image/functions/imagecreatefromwbmp.xml Fri Aug 15 18:50:50 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.30 --> <refentry id="function.imagecreatefromwbmp"> <refnamediv> @@ -24,7 +24,7 @@ <example> <title> Example to handle an error during creation (courtesy - vic@zymsys.com) + vic at zymsys dot com) </title> <programlisting role="php"> <![CDATA[ Index: phpdoc/en/reference/image/functions/imagefilledarc.xml diff -u phpdoc/en/reference/image/functions/imagefilledarc.xml:1.4 phpdoc/en/reference/image/functions/imagefilledarc.xml:1.5 --- phpdoc/en/reference/image/functions/imagefilledarc.xml:1.4 Wed Feb 12 12:49:07 2003 +++ phpdoc/en/reference/image/functions/imagefilledarc.xml Fri Aug 15 18:50:50 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/image.xml, last change in rev 1.36 --> <refentry id="function.imagefilledarc"> <refnamediv> @@ -46,7 +46,53 @@ beginning and ending angles should be connected to the center - this is a good way to outline (rather than fill) a 'pie slice'. </para> - <note><para>This function was added in PHP 4.0.6 and requires GD 2.0.1</para></note> + <para> + <example> + <title>Creating a 3D looking pie</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// this example is provided by poxy at klam dot is + +// create image +$image = imagecreate(100, 100); + +// allocate some solors +$white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); +$gray = imagecolorallocate($image, 0xC0, 0xC0, 0xC0); +$darkgray = imagecolorallocate($image, 0x90, 0x90, 0x90); +$navy = imagecolorallocate($image, 0x00, 0x00, 0x80); +$darknavy = imagecolorallocate($image, 0x00, 0x00, 0x50); +$red = imagecolorallocate($image, 0xFF, 0x00, 0x00); +$darkred = imagecolorallocate($image, 0x90, 0x00, 0x00); + +// make the 3D effect +for ($i = 60; $i > 50; $i--) { + imagefilledarc($image, 50, $i, 100, 50, 0, 45, $darknavy, IMG_ARC_PIE); + imagefilledarc($image, 50, $i, 100, 50, 45, 75 , $darkgray, IMG_ARC_PIE); + imagefilledarc($image, 50, $i, 100, 50, 75, 360 , $darkred, IMG_ARC_PIE); +} + +imagefilledarc($image, 50, 50, 100, 50, 0, 45, $navy, IMG_ARC_PIE); +imagefilledarc($image, 50, 50, 100, 50, 45, 75 , $gray, IMG_ARC_PIE); +imagefilledarc($image, 50, 50, 100, 50, 75, 360 , $red, IMG_ARC_PIE); + + +// flush image +header('Content-type: image/png'); +imagepng($image); +imagedestroy($image); +?> +]]> + </programlisting> + </example> + </para> + <note> + <para> + This function was added in PHP 4.0.6 and requires GD 2.0.1 + </para> + </note> </refsect1> </refentry> Index: phpdoc/en/reference/image/functions/imagefilledellipse.xml diff -u phpdoc/en/reference/image/functions/imagefilledellipse.xml:1.4 phpdoc/en/reference/image/functions/imagefilledellipse.xml:1.5 --- phpdoc/en/reference/image/functions/imagefilledellipse.xml:1.4 Wed Feb 12 12:49:07 2003 +++ phpdoc/en/reference/image/functions/imagefilledellipse.xml Fri Aug 15 18:50:50 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/image.xml, last change in rev 1.36 --> <refentry id="function.imagefilledellipse"> <refnamediv> @@ -25,7 +25,11 @@ ellipse's width and height respectively. The ellipse is filled using <parameter>color</parameter> </para> - <note><para>This function was added in PHP 4.0.6 and requires GD 2.0.1 or later</para></note> + <note> + <para> + This function was added in PHP 4.0.6 and requires GD 2.0.1 or later + </para> + </note> <para> See also <function>imagefilledarc</function>. </para> Index: phpdoc/en/reference/image/functions/imagefilledpolygon.xml diff -u phpdoc/en/reference/image/functions/imagefilledpolygon.xml:1.4 phpdoc/en/reference/image/functions/imagefilledpolygon.xml:1.5 --- phpdoc/en/reference/image/functions/imagefilledpolygon.xml:1.4 Wed Feb 12 12:49:07 2003 +++ phpdoc/en/reference/image/functions/imagefilledpolygon.xml Fri Aug 15 18:50:50 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- splitted from ./en/functions/image.xml, last change in rev 1.2 --> <refentry id="function.imagefilledpolygon"> <refnamediv> @@ -22,6 +22,51 @@ 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 vertices. + </para> + <para> + <example> + <title><function>imagefilledpolygon</function> example</title> + <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 +); + +// create image +$im = imagecreate(250, 250); + +// some colors +$bg = imagecolorallocate($im, 255, 255, 255); +$blue = imagecolorallocate($im, 0, 0, 255); + +// draw a polygon +imagefilledpolygon($im, $values, 6, $blue ); + +// flush image +header('Content-type: image/png'); +imagepng($im); +imagedestroy($im); + +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry>
« previous php.doc (#969355805) next »