cvs: phpdoc-fr /reference/image/functions imagecolorsforindex.xml imagecolorstotal.xml imagecolortransparent.xml imageconvolution.xml imagecopy.xml
imagecopymerge.xml imagecopymergegray.xml imagecopyresampled.xml imagecopyresized.xml imagecreate.xml imagecreatefromgd.xml imagecreatefromgd2.xml
imagecreatefromgd2part.xml imagecreatefromgif.xml imagecreatefromjpeg.xml imagecreatefrompng.xml imagecreatefromstring.xml imagecreatefromwbmp.xml
imagecreatefromxbm.xml imagecreatefromxpm.xml imagecreatetruecolor.xml imagedashedline.xml imagedestroy.xml imageellipse.xml imagefilledarc.xml
imagefilledellipse.xml imagefilledpolygon.xml imagefilledrectangle.xml imagefilltoborder.xml

From: Date: Sun, 14 Dec 2008 10:21:09 +0000
Subject: cvs: phpdoc-fr /reference/image/functions imagecolorsforindex.xml imagecolorstotal.xml imagecolortransparent.xml imageconvolution.xml imagecopy.xml
imagecopymerge.xml imagecopymergegray.xml imagecopyresampled.xml imagecopyresized.xml imagecreate.xml imagecreatefromgd.xml imagecreatefromgd2.xml
imagecreatefromgd2part.xml imagecreatefromgif.xml imagecreatefromjpeg.xml imagecreatefrompng.xml imagecreatefromstring.xml imagecreatefromwbmp.xml
imagecreatefromxbm.xml imagecreatefromxpm.xml imagecreatetruecolor.xml imagedashedline.xml imagedestroy.xml imageellipse.xml imagefilledarc.xml
imagefilledellipse.xml imagefilledpolygon.xml imagefilledrectangle.xml imagefilltoborder.xml
Groups: php.doc.fr 
Request: Send a blank email to doc-fr+get-6157@lists.php.net to get a copy of this message
yannick Sun Dec 14 10:21:09 2008 UTC Modified files: /phpdoc-fr/reference/image/functions imagecolorsforindex.xml imagecolorstotal.xml imagecolortransparent.xml imageconvolution.xml imagecopymergegray.xml imagecopymerge.xml imagecopyresampled.xml imagecopyresized.xml imagecopy.xml imagecreatefromgd2part.xml imagecreatefromgd2.xml imagecreatefromgd.xml imagecreatefromgif.xml imagecreatefromjpeg.xml imagecreatefrompng.xml imagecreatefromstring.xml imagecreatefromwbmp.xml imagecreatefromxbm.xml imagecreatefromxpm.xml imagecreatetruecolor.xml imagecreate.xml imagedashedline.xml imagedestroy.xml imageellipse.xml imagefilledarc.xml imagefilledellipse.xml imagefilledpolygon.xml imagefilledrectangle.xml imagefilltoborder.xml Log: sync with EN

http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecolorsforindex.xml?r1=1.15&r2=1.16&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecolorsforindex.xml diff -u phpdoc-fr/reference/image/functions/imagecolorsforindex.xml:1.15 phpdoc-fr/reference/image/functions/imagecolorsforindex.xml:1.16 --- phpdoc-fr/reference/image/functions/imagecolorsforindex.xml:1.15 Wed Jun 11 16:39:25 2008 +++ phpdoc-fr/reference/image/functions/imagecolorsforindex.xml Sun Dec 14 10:21:08 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.15 $ --> -<!-- EN-Revision: 1.7 Maintainer: didou Status: ready --> +<!-- $Revision: 1.16 $ --> +<!-- EN-Revision: 1.9 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagecolorsforindex" xmlns="http://docbook.org/ns/docbook"> @@ -19,6 +19,7 @@ Retourne la couleur associée à un index spécifié. </para> </refsect1> + <refsect1 role="parameters"> &reftitle.parameters; <para> @@ -28,12 +29,14 @@ <term><parameter>index</parameter></term> <listitem> <para> + L'index de la couleur. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> + <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> @@ -42,6 +45,7 @@ qui contiennent les valeurs pour l'index de la couleur spécifiée. </para> </refsect1> + <refsect1 role="examples"> &reftitle.examples; <para> @@ -83,6 +87,7 @@ </example> </para> </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecolorstotal.xml?r1=1.13&r2=1.14&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecolorstotal.xml diff -u phpdoc-fr/reference/image/functions/imagecolorstotal.xml:1.13 phpdoc-fr/reference/image/functions/imagecolorstotal.xml:1.14 --- phpdoc-fr/reference/image/functions/imagecolorstotal.xml:1.13 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imagecolorstotal.xml Sun Dec 14 10:21:08 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.13 $ --> -<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.14 $ --> +<!-- EN-Revision: 1.9 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagecolorstotal" xmlns="http://docbook.org/ns/docbook"> @@ -18,6 +18,7 @@ Retourne le nombre de couleurs de la palette de l'image. </para> </refsect1> + <refsect1 role="parameters"> &reftitle.parameters; <para> @@ -26,6 +27,7 @@ </variablelist> </para> </refsect1> + <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> @@ -34,6 +36,36 @@ truecolor. </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Récupération du nombre total de couleurs dans une image en utilisant + la fonction <function>imagecolorstotal</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Création d'une instance d'image +$im = imagecreatefromgif('php.gif'); + +echo 'Nombre total de couleurs dans l\'image : ' . imagecolorstotal($im); + +// Libération de la mémoire +imagedestroy($im); +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +Nombre total de couleurs dans l'image : 128 +]]> + </screen> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecolortransparent.xml?r1=1.16&r2=1.17&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecolortransparent.xml diff -u phpdoc-fr/reference/image/functions/imagecolortransparent.xml:1.16 phpdoc-fr/reference/image/functions/imagecolortransparent.xml:1.17 --- phpdoc-fr/reference/image/functions/imagecolortransparent.xml:1.16 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imagecolortransparent.xml Sun Dec 14 10:21:08 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.16 $ --> -<!-- EN-Revision: 1.10 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.17 $ --> +<!-- EN-Revision: 1.12 Maintainer: yannick Status: ready --> <!-- Reviewed: no --> <refentry xml:id="function.imagecolortransparent" xmlns="http://docbook.org/ns/docbook"> @@ -29,13 +29,14 @@ <listitem> <para> Un identifiant de couleur créé par la fonction - <function>imagecolorallocate</function> + <function>imagecolorallocate</function>. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> + <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> @@ -43,20 +44,58 @@ si aucune n'est spécifiée) est retourné. </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemple avec <function>imagecolortransparent</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Création d'une image de 55x30 +$im = imagecreatetruecolor(55, 30); +$red = imagecolorallocate($im, 255, 0, 0); +$black = imagecolorallocate($im, 0, 0, 0); + +// On rend l'arrière-plan transparent +imagecolortransparent($im, $black); + +// On dessine un rectangle rouge +imagefilledrectangle($im, 4, 4, 50, 25, $red); + +// On sauvegarde l'image +imagepng($im, './imagecolortransparent.png'); +imagedestroy($im); +?> +]]> + </programlisting> + &example.outputs.similar; + <mediaobject> + <imageobject> + <imagedata fileref="figures/image.imagecolortransparent.png"/> + </imageobject> + </mediaobject> + </example> + </para> + </refsect1> + <refsect1 role="notes"> &reftitle.notes; <note> <para> - La transparence est copiée uniquement avec la fonction <function>imagecopymerge</function> - et les images en couleur vraies, non pas avec la fonction <function>imagecopy</function> - ou les images de palette. + La transparence est copiée uniquement avec la fonction + <function>imagecopymerge</function> et les images en couleur vraies, + non pas avec la fonction <function>imagecopy</function> ou les images + de palette. </para> </note> <note> <para> - La couleur de transparence est une propriété de l'image, elle n'est pas une propriété de la couleur. - Une fois que vous avez défini la couleur de transparence, chaque région de l'image de cette couleur - que vous avez dessiné précédemment sera transparente. + La couleur de transparence est une propriété de l'image, elle n'est pas + une propriété de la couleur. Une fois que vous avez défini la couleur de + transparence, chaque région de l'image de cette couleur que vous avez + dessiné précédemment sera transparente. </para> </note> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imageconvolution.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc-fr/reference/image/functions/imageconvolution.xml diff -u phpdoc-fr/reference/image/functions/imageconvolution.xml:1.7 phpdoc-fr/reference/image/functions/imageconvolution.xml:1.8 --- phpdoc-fr/reference/image/functions/imageconvolution.xml:1.7 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imageconvolution.xml Sun Dec 14 10:21:08 2008 @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.7 $ --> -<!-- EN-Revision: 1.5 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.8 $ --> +<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready --> <!-- Reviewed: no --> <refentry xml:id="function.imageconvolution" xmlns="http://docbook.org/ns/docbook"> @@ -30,7 +30,8 @@ <term><parameter>matrix</parameter></term> <listitem> <para> - Une matrice 3x3 : un tableau contenant trois tableaux de trois nombres à virgules flottantes. + Une matrice 3x3 : un tableau contenant trois tableaux de trois + nombres à virgules flottantes. </para> </listitem> </varlistentry> @@ -46,18 +47,21 @@ <term><parameter>offset</parameter></term> <listitem> <para> + La position de la couleur. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> + <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> + <refsect1 role="examples"> &reftitle.examples; <para> @@ -112,10 +116,12 @@ </example> </para> </refsect1> + <refsect1 role="notes"> &reftitle.notes; &note.bundled.gd; </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecopymergegray.xml?r1=1.14&r2=1.15&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecopymergegray.xml diff -u phpdoc-fr/reference/image/functions/imagecopymergegray.xml:1.14 phpdoc-fr/reference/image/functions/imagecopymergegray.xml:1.15 --- phpdoc-fr/reference/image/functions/imagecopymergegray.xml:1.14 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imagecopymergegray.xml Sun Dec 14 10:21:08 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.14 $ --> -<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.15 $ --> +<!-- EN-Revision: 1.10 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagecopymergegray" xmlns="http://docbook.org/ns/docbook"> @@ -48,7 +48,7 @@ <term><parameter>dst_im</parameter></term> <listitem> <para> - Ressource de l'image de destination + Ressource de l'image de destination. </para> </listitem> </varlistentry> @@ -56,7 +56,7 @@ <term><parameter>src_im</parameter></term> <listitem> <para> - Ressource de l'image source + Ressource de l'image source. </para> </listitem> </varlistentry> @@ -64,7 +64,7 @@ <term><parameter>dst_x</parameter></term> <listitem> <para> - X : coordonnée du point de destination + X : coordonnée du point de destination. </para> </listitem> </varlistentry> @@ -72,7 +72,7 @@ <term><parameter>dst_y</parameter></term> <listitem> <para> - Y : coordonnée du point de destination + Y : coordonnée du point de destination. </para> </listitem> </varlistentry> @@ -80,7 +80,7 @@ <term><parameter>src_x</parameter></term> <listitem> <para> - X : coordonnée du point source + X : coordonnée du point source. </para> </listitem> </varlistentry> @@ -88,7 +88,7 @@ <term><parameter>src_y</parameter></term> <listitem> <para> - Y : coordonnée du point source + Y : coordonnée du point source. </para> </listitem> </varlistentry> @@ -96,7 +96,7 @@ <term><parameter>src_w</parameter></term> <listitem> <para> - Largeur de la source + Largeur de la source. </para> </listitem> </varlistentry> @@ -104,7 +104,7 @@ <term><parameter>src_h</parameter></term> <listitem> <para> - Hauteur de la source + Hauteur de la source. </para> </listitem> </varlistentry> @@ -112,24 +112,55 @@ <term><parameter>pct</parameter></term> <listitem> <para> - Les deux images seront fusionnées - suivant le paramètre <parameter>pct</parameter>, qui peut valoir de - 0 à 100. Si <parameter>pct</parameter> = 0, aucune action n'est - faite, alors que si <parameter>pct</parameter> = 100, - <function>imagecopymerge</function> se comporte exactement comme - <function>imagecopy</function>. + Le paramètre <parameter>src_im</parameter> sera changé + en niveaux de gris en accord avec le paramètre + <parameter>pct</parameter> où 0 correspond à une convertion totale en + niveaux de gris et 100 ne modifie rien. + Lorsque <parameter>pct</parameter> = 100, cette fonction se comporte de la + même façon que la fonction <function>imagecopy</function> pour les palettes, + alors qu'elle implémente la transparene alpha pour les images true colour. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> + <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemple avec <function>imagecopymergegray</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Création des instances d'image +$dest = imagecreatefromgif('php.gif'); +$src = imagecreatefromgif('php.gif'); + +// Copie et fusionne - Gris = 20% +imagecopymergegray($dest, $src, 10, 10, 0, 0, 100, 47, 20); + +// Affichage et libère la mémoire +header('Content-Type: image/gif'); +imagegif($dest); + +imagedestroy($dest); +imagedestroy($src); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecopymerge.xml?r1=1.15&r2=1.16&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecopymerge.xml diff -u phpdoc-fr/reference/image/functions/imagecopymerge.xml:1.15 phpdoc-fr/reference/image/functions/imagecopymerge.xml:1.16 --- phpdoc-fr/reference/image/functions/imagecopymerge.xml:1.15 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imagecopymerge.xml Sun Dec 14 10:21:08 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.15 $ --> -<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.16 $ --> +<!-- EN-Revision: 1.10 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagecopymerge" xmlns="http://docbook.org/ns/docbook"> @@ -41,7 +41,7 @@ <term><parameter>dst_im</parameter></term> <listitem> <para> - Ressource de l'image de destination + Ressource de l'image de destination. </para> </listitem> </varlistentry> @@ -49,7 +49,7 @@ <term><parameter>src_im</parameter></term> <listitem> <para> - Ressource de l'image source + Ressource de l'image source. </para> </listitem> </varlistentry> @@ -57,7 +57,7 @@ <term><parameter>dst_x</parameter></term> <listitem> <para> - X : coordonnée du point de destination + X : coordonnée du point de destination. </para> </listitem> </varlistentry> @@ -65,7 +65,7 @@ <term><parameter>dst_y</parameter></term> <listitem> <para> - Y : coordonnée du point de destination + Y : coordonnée du point de destination. </para> </listitem> </varlistentry> @@ -73,7 +73,7 @@ <term><parameter>src_x</parameter></term> <listitem> <para> - X : coordonnée du point source + X : coordonnée du point source. </para> </listitem> </varlistentry> @@ -81,7 +81,7 @@ <term><parameter>src_y</parameter></term> <listitem> <para> - Y : coordonnée du point source + Y : coordonnée du point source. </para> </listitem> </varlistentry> @@ -89,7 +89,7 @@ <term><parameter>src_w</parameter></term> <listitem> <para> - Largeur de la source + Largeur de la source. </para> </listitem> </varlistentry> @@ -97,7 +97,7 @@ <term><parameter>src_h</parameter></term> <listitem> <para> - Hauteur de la source + Hauteur de la source. </para> </listitem> </varlistentry> @@ -118,12 +118,42 @@ </variablelist> </para> </refsect1> + <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Fusionne 2 copies du logo PHP.net avec 75% de transparence</title> + <programlisting role="php"> +<![CDATA[ +<?php +// Création des instances d'image +$dest = imagecreatefromgif('php.gif'); +$src = imagecreatefromgif('php.gif'); + +// Copie et fusionne +imagecopymerge($dest, $src, 10, 10, 0, 0, 100, 47, 75); + +// Affichage et libération de la mémoire +header('Content-Type: image/gif'); +imagegif($dest); + +imagedestroy($dest); +imagedestroy($src); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecopyresampled.xml?r1=1.24&r2=1.25&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecopyresampled.xml diff -u phpdoc-fr/reference/image/functions/imagecopyresampled.xml:1.24 phpdoc-fr/reference/image/functions/imagecopyresampled.xml:1.25 --- phpdoc-fr/reference/image/functions/imagecopyresampled.xml:1.24 Mon Apr 14 23:58:18 2008 +++ phpdoc-fr/reference/image/functions/imagecopyresampled.xml Sun Dec 14 10:21:08 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.24 $ --> -<!-- EN-Revision: 1.13 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.25 $ --> +<!-- EN-Revision: 1.14 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagecopyresampled" xmlns="http://docbook.org/ns/docbook"> @@ -58,7 +58,7 @@ <term><parameter>dst_im</parameter></term> <listitem> <para> - Lien vers la ressource de l'image de destination + Lien vers la ressource de l'image de destination. </para> </listitem> </varlistentry> @@ -66,7 +66,7 @@ <term><parameter>src_im</parameter></term> <listitem> <para> - Lien vers la ressource de l'image source + Lien vers la ressource de l'image source. </para> </listitem> </varlistentry> @@ -74,7 +74,7 @@ <term><parameter>dst_x</parameter></term> <listitem> <para> - X : coordonnées du point de destination + X : coordonnées du point de destination. </para> </listitem> </varlistentry> @@ -82,7 +82,7 @@ <term><parameter>dst_y</parameter></term> <listitem> <para> - Y : coordonnées du point de destination + Y : coordonnées du point de destination. </para> </listitem> </varlistentry> @@ -90,7 +90,7 @@ <term><parameter>src_x</parameter></term> <listitem> <para> - X : coordonnées du point source + X : coordonnées du point source. </para> </listitem> </varlistentry> @@ -98,7 +98,7 @@ <term><parameter>src_y</parameter></term> <listitem> <para> - Y : coordonnées du point source + Y : coordonnées du point source. </para> </listitem> </varlistentry> @@ -106,7 +106,7 @@ <term><parameter>dst_w</parameter></term> <listitem> <para> - Largeur de la destination + Largeur de la destination. </para> </listitem> </varlistentry> @@ -114,7 +114,7 @@ <term><parameter>dst_h</parameter></term> <listitem> <para> - Hauteur de la destination + Hauteur de la destination. </para> </listitem> </varlistentry> @@ -122,7 +122,7 @@ <term><parameter>src_w</parameter></term> <listitem> <para> - Largeur de la source + Largeur de la source. </para> </listitem> </varlistentry> @@ -130,7 +130,7 @@ <term><parameter>src_h</parameter></term> <listitem> <para> - Hauteur de la source + Hauteur de la source. </para> </listitem> </varlistentry> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecopyresized.xml?r1=1.21&r2=1.22&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecopyresized.xml diff -u phpdoc-fr/reference/image/functions/imagecopyresized.xml:1.21 phpdoc-fr/reference/image/functions/imagecopyresized.xml:1.22 --- phpdoc-fr/reference/image/functions/imagecopyresized.xml:1.21 Mon Apr 14 18:30:07 2008 +++ phpdoc-fr/reference/image/functions/imagecopyresized.xml Sun Dec 14 10:21:08 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.21 $ --> -<!-- EN-Revision: 1.11 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.22 $ --> +<!-- EN-Revision: 1.13 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagecopyresized" xmlns="http://docbook.org/ns/docbook"> @@ -58,7 +58,7 @@ <term><parameter>dst_im</parameter></term> <listitem> <para> - Lien vers la ressource de l'image de destination + Lien vers la ressource de l'image de destination. </para> </listitem> </varlistentry> @@ -66,7 +66,7 @@ <term><parameter>src_im</parameter></term> <listitem> <para> - Lien vers la ressource de l'image source + Lien vers la ressource de l'image source. </para> </listitem> </varlistentry> @@ -74,7 +74,7 @@ <term><parameter>dst_x</parameter></term> <listitem> <para> - X : coordonnée du point de destination + X : coordonnée du point de destination. </para> </listitem> </varlistentry> @@ -82,7 +82,7 @@ <term><parameter>dst_y</parameter></term> <listitem> <para> - Y : coordonnée du point de destination + Y : coordonnée du point de destination. </para> </listitem> </varlistentry> @@ -90,7 +90,7 @@ <term><parameter>src_x</parameter></term> <listitem> <para> - X : coordonnée du point source + X : coordonnée du point source. </para> </listitem> </varlistentry> @@ -98,7 +98,7 @@ <term><parameter>src_y</parameter></term> <listitem> <para> - Y : coordonnée du point source + Y : coordonnée du point source. </para> </listitem> </varlistentry> @@ -106,7 +106,7 @@ <term><parameter>dst_w</parameter></term> <listitem> <para> - Largeur de la destination + Largeur de la destination. </para> </listitem> </varlistentry> @@ -114,7 +114,7 @@ <term><parameter>dst_h</parameter></term> <listitem> <para> - Hauteur de la destination + Hauteur de la destination. </para> </listitem> </varlistentry> @@ -122,7 +122,7 @@ <term><parameter>src_w</parameter></term> <listitem> <para> - Largeur de la source + Largeur de la source. </para> </listitem> </varlistentry> @@ -130,7 +130,7 @@ <term><parameter>src_h</parameter></term> <listitem> <para> - Hauteur de la source + Hauteur de la source. </para> </listitem> </varlistentry> @@ -181,7 +181,7 @@ &example.outputs.similar; <mediaobject> <imageobject> - <imagedata fileref="figures/image.imagecopyresized.jpg" /> + <imagedata fileref="figures/image.imagecopyresized.jpg"/> </imageobject> </mediaobject> <para> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecopy.xml?r1=1.13&r2=1.14&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecopy.xml diff -u phpdoc-fr/reference/image/functions/imagecopy.xml:1.13 phpdoc-fr/reference/image/functions/imagecopy.xml:1.14 --- phpdoc-fr/reference/image/functions/imagecopy.xml:1.13 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imagecopy.xml Sun Dec 14 10:21:08 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.13 $ --> -<!-- EN-Revision: 1.6 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.14 $ --> +<!-- EN-Revision: 1.8 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagecopy" xmlns="http://docbook.org/ns/docbook"> @@ -38,7 +38,7 @@ <term><parameter>dst_im</parameter></term> <listitem> <para> - Lien vers la ressource de l'image de destination + Lien vers la ressource de l'image de destination. </para> </listitem> </varlistentry> @@ -46,7 +46,7 @@ <term><parameter>src_im</parameter></term> <listitem> <para> - Lien vers la ressource de l'image source + Lien vers la ressource de l'image source. </para> </listitem> </varlistentry> @@ -54,7 +54,7 @@ <term><parameter>dst_x</parameter></term> <listitem> <para> - X : coordonnées du point de destination + X : coordonnées du point de destination. </para> </listitem> </varlistentry> @@ -62,7 +62,7 @@ <term><parameter>dst_y</parameter></term> <listitem> <para> - Y : coordonnées du point de destination + Y : coordonnées du point de destination. </para> </listitem> </varlistentry> @@ -70,7 +70,7 @@ <term><parameter>src_x</parameter></term> <listitem> <para> - X : coordonnées du point source + X : coordonnées du point source. </para> </listitem> </varlistentry> @@ -78,7 +78,7 @@ <term><parameter>src_y</parameter></term> <listitem> <para> - Y : coordonnées du point source + Y : coordonnées du point source. </para> </listitem> </varlistentry> @@ -86,7 +86,7 @@ <term><parameter>src_w</parameter></term> <listitem> <para> - Largeur de la source + Largeur de la source. </para> </listitem> </varlistentry> @@ -94,7 +94,7 @@ <term><parameter>src_h</parameter></term> <listitem> <para> - Hauteur de la source + Hauteur de la source. </para> </listitem> </varlistentry> @@ -107,6 +107,41 @@ &return.success; </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>On coupe le logo PHP.net</title> + <programlisting role="php"> +<![CDATA[ +<?php +// Création des instances d'image +$src = imagecreatefromgif('php.gif'); +$dest = imagecreatetruecolor(80, 40); + +// Copie +imagecopy($dest, $src, 0, 0, 20, 13, 80, 40); + +// Affichage et libération de la mémoire +header('Content-Type: image/gif'); +imagegif($dest); + +imagedestroy($dest); +imagedestroy($src); +?> +]]> + </programlisting> + &example.outputs.similar; + <mediaobject> + <imageobject> + <imagedata fileref="figures/image.imagecopy.gif"/> + </imageobject> + </mediaobject> + </example> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecreatefromgd2part.xml?r1=1.13&r2=1.14&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecreatefromgd2part.xml diff -u phpdoc-fr/reference/image/functions/imagecreatefromgd2part.xml:1.13 phpdoc-fr/reference/image/functions/imagecreatefromgd2part.xml:1.14 --- phpdoc-fr/reference/image/functions/imagecreatefromgd2part.xml:1.13 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imagecreatefromgd2part.xml Sun Dec 14 10:21:08 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.13 $ --> -<!-- EN-Revision: 1.8 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.14 $ --> +<!-- EN-Revision: 1.12 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id='function.imagecreatefromgd2part' xmlns="http://docbook.org/ns/docbook"> @@ -18,7 +18,9 @@ <methodparam><type>int</type><parameter>width</parameter></methodparam> <methodparam><type>int</type><parameter>height</parameter></methodparam> </methodsynopsis> - &warn.undocumented.func; + <para> + Crée une nouvelle image depuis une partie d'un fichier GD2 ou d'une URL. + </para> &tip.fopen-wrapper; </refsect1> <refsect1 role="parameters"> @@ -29,6 +31,7 @@ <term><parameter>filename</parameter></term> <listitem> <para> + Chemin vers l'image GD2. </para> </listitem> </varlistentry> @@ -36,6 +39,7 @@ <term><parameter>srcX</parameter></term> <listitem> <para> + Coordonnée en X du point source. </para> </listitem> </varlistentry> @@ -43,6 +47,7 @@ <term><parameter>srcY</parameter></term> <listitem> <para> + Coordonnée en Y du point source. </para> </listitem> </varlistentry> @@ -50,6 +55,7 @@ <term><parameter>width</parameter></term> <listitem> <para> + Largeur de la source. </para> </listitem> </varlistentry> @@ -57,17 +63,58 @@ <term><parameter>height</parameter></term> <listitem> <para> + Hauteur de la source. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Retourne un identifiant de ressource d'image en cas de succès, + ou &false; si une erreur survient. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemple avec <function>imagecreatefromgd2part</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Pour cette exemple, nous avons tout d'abord besoin des dimensions de l'image +$image = getimagesize('./test.gd2'); + +// Création de l'instance d'image maintenant que nous avons les dimensions +$im = imagecreatefromgd2part('./test.gd2', 4, 4, ($image[0] / 2) - 6, ($image[1] / 2) - 6); + +// Opération sur l'image : ici, nous imprimons l'image si nous utilisons PHP5+ +if(function_exists('imagefilter')) +{ + imagefilter($im, IMG_FILTER_EMBOSS); +} + +// Sauvegarde de l'image optimisée +imagegd2($im, './test_emboss.gd2'); +imagedestroy($im); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="notes"> &reftitle.notes; &note.gd.2; &warn.no-win32-fopen-wrapper; </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecreatefromgd2.xml?r1=1.11&r2=1.12&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecreatefromgd2.xml diff -u phpdoc-fr/reference/image/functions/imagecreatefromgd2.xml:1.11 phpdoc-fr/reference/image/functions/imagecreatefromgd2.xml:1.12 --- phpdoc-fr/reference/image/functions/imagecreatefromgd2.xml:1.11 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imagecreatefromgd2.xml Sun Dec 14 10:21:08 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> -<!-- EN-Revision: 1.8 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.12 $ --> +<!-- EN-Revision: 1.11 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id='function.imagecreatefromgd2' xmlns="http://docbook.org/ns/docbook"> @@ -14,9 +14,12 @@ <type>resource</type><methodname>imagecreatefromgd2</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> </methodsynopsis> - &warn.undocumented.func; + <para> + Crée une nouvelle image depuis un fichier GD2 ou une URL. + </para> &tip.fopen-wrapper; </refsect1> + <refsect1 role="parameters"> &reftitle.parameters; <para> @@ -25,17 +28,56 @@ <term><parameter>filename</parameter></term> <listitem> <para> + Chemin vers l'image GD2. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Retourne un identifiant de ressource d'image en cas de succès, + ou &false; si une erreur survient. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemple avec <function>imagecreatefromgd2</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Charge l'image gd2 +$im = imagecreatefromgd2('./test.gd2'); + +// Applique un effet sur l'image : on applique ici un filtre négatif si nous +// utilisons PHP5+ +if(function_exists('imagefilter')) +{ + imagefilter($im, IMG_FILTER_NEGATE); +} + +// Sauvegarde de l'image +imagegd2($im, './test_updated.gd2'); +imagedestroy($im); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="notes"> &reftitle.notes; &note.gd.2; &warn.no-win32-fopen-wrapper; </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecreatefromgd.xml?r1=1.10&r2=1.11&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecreatefromgd.xml diff -u phpdoc-fr/reference/image/functions/imagecreatefromgd.xml:1.10 phpdoc-fr/reference/image/functions/imagecreatefromgd.xml:1.11 --- phpdoc-fr/reference/image/functions/imagecreatefromgd.xml:1.10 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imagecreatefromgd.xml Sun Dec 14 10:21:08 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.10 $ --> -<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.11 $ --> +<!-- EN-Revision: 1.10 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id='function.imagecreatefromgd' xmlns="http://docbook.org/ns/docbook"> @@ -15,10 +15,11 @@ <methodparam><type>string</type><parameter>filename</parameter></methodparam> </methodsynopsis> <para> - &warn.undocumented.func; + Crée une nouvelle image depuis un fichier GD ou une URL. </para> &tip.fopen-wrapper; </refsect1> + <refsect1 role="parameters"> &reftitle.parameters; <para> @@ -27,12 +28,51 @@ <term><parameter>filename</parameter></term> <listitem> <para> + Chemin vers un fichier GD. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Retourne un identifiant de ressource image en cas de succès, + ou &false; si une erreur survient. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemple avec <function>imagecreatefromgd</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Charge une image GD +$im = @imagecreatefromgd('./test.gd'); + +// Vérifie si l'image est bien chargée +if(!is_resource($im)) +{ + die('Impossible de charger l\'image GD'); +} + +// Des opérations sur l'image ici + +// Sauvegarde de l'image +imagegd($im, './test_updated.gd'); +imagedestroy($im); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="notes"> &reftitle.notes; &warn.no-win32-fopen-wrapper; http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecreatefromgif.xml?r1=1.22&r2=1.23&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecreatefromgif.xml diff -u phpdoc-fr/reference/image/functions/imagecreatefromgif.xml:1.22 phpdoc-fr/reference/image/functions/imagecreatefromgif.xml:1.23 --- phpdoc-fr/reference/image/functions/imagecreatefromgif.xml:1.22 Mon Apr 14 23:58:18 2008 +++ phpdoc-fr/reference/image/functions/imagecreatefromgif.xml Sun Dec 14 10:21:08 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.22 $ --> -<!-- EN-Revision: 1.18 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.23 $ --> +<!-- EN-Revision: 1.22 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagecreatefromgif" xmlns="http://docbook.org/ns/docbook"> @@ -19,40 +19,6 @@ représente l'image obtenue à partir du fichier dont le nom est donné par <parameter>filename</parameter>. </para> - <para> - Pour simplifier le déboguage, utilisez le code suivant, qui retourne une - erreur <acronym>GIF</acronym> : - <example> - <title>Exemple de gestion des erreurs durant la création d'image</title> - <programlisting role="php"> -<![CDATA[ -<?php -function LoadGif ($imgname) { - $im = @imagecreatefromgif ($imgname); /* Tentative d'ouverture */ - if (!$im) { /* Test d'échec */ - $im = imagecreatetruecolor (150, 30); /* Création d'une image vide */ - $bgc = imagecolorallocate ($im, 255, 255, 255); - $tc = imagecolorallocate ($im, 0, 0, 0); - imagefilledrectangle ($im, 0, 0, 150, 30, $bgc); - /* Affichage d'un message d'erreur */ - imagestring ($im, 1, 5, 5, "Erreur au chargement de l'image $imgname", $tc); - } - return $im; -} -header("Content-Type: image/gif"); -$img = LoadGif("bogus.image"); -imagegif($img); -?> -]]> - </programlisting> - &example.outputs.similar; - <mediaobject> - <imageobject> - <imagedata fileref="figures/image.imagecreatefromgif.gif" /> - </imageobject> - </mediaobject> - </example> - </para> &tip.fopen-wrapper; </refsect1> <refsect1 role="parameters"> @@ -63,7 +29,7 @@ <term><parameter>filename</parameter></term> <listitem> <para> - Chemin vers l'image WBMP + Chemin vers l'image GIF. </para> </listitem> </varlistentry> @@ -77,6 +43,53 @@ si une erreur survient. </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <example> + <title>Exemple de prise en charge d'une erreur lors du chargement d'une + image GIF</title> + <programlisting role="php"> +<![CDATA[ +<?php +function LoadGif($imgname) +{ + /* Tente d'ouvrir l'image */ + $im = @imagecreatefromgif($imgname); + + /* Traitement si l'ouverture à échouer */ + if(!$im) + { + /* Création d'une image vide */ + $im = imagecreatetruecolor (150, 30); + $bgc = imagecolorallocate ($im, 255, 255, 255); + $tc = imagecolorallocate ($im, 0, 0, 0); + + imagefilledrectangle ($im, 0, 0, 150, 30, $bgc); + + /* Affiche un message d'erreur dans l'image */ + imagestring ($im, 1, 5, 5, 'Error loading ' . $imgname, $tc); + } + + return $im; +} + +header('Content-Type: image/gif'); + +$img = LoadGif('bogus.image'); + +imagegif($img); +imagedestroy($img); +?> +]]> + </programlisting> + &example.outputs.similar; + <mediaobject> + <imageobject> + <imagedata fileref="figures/image.imagecreatefromgif.gif"/> + </imageobject> + </mediaobject> + </example> + </refsect1> <refsect1 role="notes"> &reftitle.notes; <note> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecreatefromjpeg.xml?r1=1.21&r2=1.22&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecreatefromjpeg.xml diff -u phpdoc-fr/reference/image/functions/imagecreatefromjpeg.xml:1.21 phpdoc-fr/reference/image/functions/imagecreatefromjpeg.xml:1.22 --- phpdoc-fr/reference/image/functions/imagecreatefromjpeg.xml:1.21 Thu May 22 22:54:34 2008 +++ phpdoc-fr/reference/image/functions/imagecreatefromjpeg.xml Sun Dec 14 10:21:08 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.21 $ --> -<!-- EN-Revision: 1.19 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.22 $ --> +<!-- EN-Revision: 1.22 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagecreatefromjpeg" xmlns="http://docbook.org/ns/docbook"> @@ -19,41 +19,6 @@ représentant une image obtenue à partir du fichier <parameter>filename</parameter>. </para> - <para> - En cas d'échec, <function>imagecreatefromjpeg</function> affiche un message - d'erreur, qui est représenté comme un lien brisé dans un navigateur web. - Pour faciliter le déboguage, voici une erreur <acronym>JPEG</acronym> : - <example> - <title>Exemple de gestion d'erreur lors de la création d'image</title> - <programlisting role="php"> -<![CDATA[ -<?php -function LoadJpeg($imgname) { - $im = @imagecreatefromjpeg($imgname); /* Tentative d'ouverture */ - if (!$im) { /* Vérification */ - $im = imagecreatetruecolor(150, 30); /* Création d'une image blanche */ - $bgc = imagecolorallocate($im, 255, 255, 255); - $tc = imagecolorallocate($im, 0, 0, 0); - imagefilledrectangle($im, 0, 0, 150, 30, $bgc); - /* Affichage d'un message d'erreur */ - imagestring($im, 1, 5, 5, "Erreur de chargement de l'image $imgname", $tc); - } - return $im; -} -header("Content-Type: image/jpeg"); -$img = LoadJpeg("bogus.image"); -imagejpeg($img); -?> -]]> - </programlisting> - &example.outputs.similar; - <mediaobject> - <imageobject> - <imagedata fileref="figures/image.imagecreatefromjpeg.jpg"/> - </imageobject> - </mediaobject> - </example> - </para> &tip.fopen-wrapper; </refsect1> <refsect1 role="parameters"> @@ -64,7 +29,7 @@ <term><parameter>filename</parameter></term> <listitem> <para> - Chemin vers l'image JPEG + Chemin vers l'image JPEG. </para> </listitem> </varlistentry> @@ -78,6 +43,53 @@ si une erreur survient. </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <example> + <title>Exemple de gestion d'une erreur lors du chargement d'une image JPEG</title> + <programlisting role="php"> +<![CDATA[ +<?php +function LoadJpeg($imgname) +{ + /* Tente d'ouvrir l'image */ + $im = @imagecreatefromjpeg($imgname); + + /* Traitement en cas d'échec */ + if(!$im) + { + /* Création d'une image vide */ + $im = imagecreatetruecolor(150, 30); + $bgc = imagecolorallocate($im, 255, 255, 255); + $tc = imagecolorallocate($im, 0, 0, 0); + + imagefilledrectangle($im, 0, 0, 150, 30, $bgc); + + /* On y affiche un message d'erreur */ + imagestring($im, 1, 5, 5, 'Erreur de chargement ' . $imgname, $tc); + } + + return $im; +} + +header('Content-Type: image/jpeg'); + +$img = LoadJpeg('bogus.image'); + +imagejpeg($img); +imagedestroy($img); +?> +]]> + </programlisting> + &example.outputs.similar; + <mediaobject> + <imageobject> + <imagedata fileref="figures/image.imagecreatefromjpeg.jpg"/> + </imageobject> + </mediaobject> + </example> + </refsect1> + <refsect1 role="notes"> &reftitle.notes; &note.config.jpeg; http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecreatefrompng.xml?r1=1.19&r2=1.20&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecreatefrompng.xml diff -u phpdoc-fr/reference/image/functions/imagecreatefrompng.xml:1.19 phpdoc-fr/reference/image/functions/imagecreatefrompng.xml:1.20 --- phpdoc-fr/reference/image/functions/imagecreatefrompng.xml:1.19 Mon Apr 14 23:58:18 2008 +++ phpdoc-fr/reference/image/functions/imagecreatefrompng.xml Sun Dec 14 10:21:08 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.19 $ --> -<!-- EN-Revision: 1.14 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.20 $ --> +<!-- EN-Revision: 1.17 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagecreatefrompng" xmlns="http://docbook.org/ns/docbook"> @@ -19,43 +19,6 @@ représentant une image obtenue à partir du fichier <parameter>filename</parameter>. </para> - <para> - <function>imagecreatefrompng</function> retourne une chaîne vide en cas - d'échec. Elle affiche aussi un message d'erreur, qui s'affiche comme un - lien brisé dans un navigateur web. Pour faciliter le déboguage, - voici une erreur <acronym>PNG</acronym> : - <example> - <title>Exemple de gestion d'erreur lors de la création d'image</title> - <programlisting role="php"> -<![CDATA[ -<?php -function LoadPNG($imgname) -{ - $im = @imagecreatefrompng($imgname); /* Tentative d'ouverture */ - if (!$im) { /* Vérification */ - $im = imagecreatetruecolor(150, 30); /* Création d'une image blanche */ - $bgc = imagecolorallocate($im, 255, 255, 255); - $tc = imagecolorallocate($im, 0, 0, 0); - imagefilledrectangle($im, 0, 0, 150, 30, $bgc); - /* Affichage d'un message d'erreur */ - imagestring($im, 1, 5, 5, "Erreur de chargement de l'image $imgname", $tc); - } - return $im; -} -header("Content-Type: image/png"); -$img = LoadPNG("bogus.image"); -imagepng($img); -?> -]]> - </programlisting> - &example.outputs.similar; - <mediaobject> - <imageobject> - <imagedata fileref="figures/image.imagecreatefrompng.png" /> - </imageobject> - </mediaobject> - </example> - </para> &tip.fopen-wrapper; </refsect1> <refsect1 role="parameters"> @@ -66,7 +29,7 @@ <term><parameter>filename</parameter></term> <listitem> <para> - Chemin vers l'image PNG + Chemin vers l'image PNG. </para> </listitem> </varlistentry> @@ -80,6 +43,46 @@ si une erreur survient. </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <example> + <title>Exemple de gestion d'une erreur lors du chargement d'une image PNG</title> + <programlisting role="php"> +<![CDATA[ +<?php +function LoadPNG($imgname) +{ + /* Tente d'ouvrir l'image */ + $im = @imagecreatefrompng($imgname); + + /* Traitement en cas d'échec */ + if(!$im) + { + /* Création d'une image vide */ + $im = imagecreatetruecolor(150, 30); + $bgc = imagecolorallocate($im, 255, 255, 255); + $tc = imagecolorallocate($im, 0, 0, 0); + + imagefilledrectangle($im, 0, 0, 150, 30, $bgc); + + /* On y affiche un message d'erreur */ + imagestring($im, 1, 5, 5, 'Erreur de chargement ' . $imgname, $tc); + } + + return $im; +} + +header('Content-Type: image/png'); + +$img = LoadPNG('bogus.image'); + +imagepng($img); +imagedestroy($img); +?> +]]> + </programlisting> + </example> + </refsect1> <refsect1 role="notes"> &reftitle.notes; &warn.no-win32-fopen-wrapper; http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecreatefromstring.xml?r1=1.17&r2=1.18&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecreatefromstring.xml diff -u phpdoc-fr/reference/image/functions/imagecreatefromstring.xml:1.17 phpdoc-fr/reference/image/functions/imagecreatefromstring.xml:1.18 --- phpdoc-fr/reference/image/functions/imagecreatefromstring.xml:1.17 Sat Jun 21 20:51:34 2008 +++ phpdoc-fr/reference/image/functions/imagecreatefromstring.xml Sun Dec 14 10:21:09 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.17 $ --> -<!-- EN-Revision: 1.12 Maintainer: jsgoupil Status: ready --> +<!-- $Revision: 1.18 $ --> +<!-- EN-Revision: 1.14 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagecreatefromstring" xmlns="http://docbook.org/ns/docbook"> @@ -17,8 +17,8 @@ <para> <function>imagecreatefromstring</function> retourne un identifiant d'image représentant l'image obtenu depuis la chaîne <parameter>image</parameter>. - Le type de l'image sera automatiquement détecté si vous avez compilé PHP avec les supports : - JPEG, PNG, GIF, WBMP et GD2. + Le type de l'image sera automatiquement détecté si vous avez compilé PHP avec + les supports : JPEG, PNG, GIF, WBMP et GD2. </para> </refsect1> <refsect1 role="parameters"> @@ -29,7 +29,7 @@ <term><parameter>image</parameter></term> <listitem> <para> - Une chaîne contenant les données de l'image + Une chaîne contenant les données de l'image. </para> </listitem> </varlistentry> @@ -62,6 +62,7 @@ if ($im !== false) { header('Content-Type: image/png'); imagepng($im); + imagedestroy($im); } else { echo 'An error occurred.'; http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecreatefromwbmp.xml?r1=1.20&r2=1.21&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecreatefromwbmp.xml diff -u phpdoc-fr/reference/image/functions/imagecreatefromwbmp.xml:1.20 phpdoc-fr/reference/image/functions/imagecreatefromwbmp.xml:1.21 --- phpdoc-fr/reference/image/functions/imagecreatefromwbmp.xml:1.20 Sat Jun 21 20:51:34 2008 +++ phpdoc-fr/reference/image/functions/imagecreatefromwbmp.xml Sun Dec 14 10:21:09 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.20 $ --> -<!-- EN-Revision: 1.14 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.21 $ --> +<!-- EN-Revision: 1.16 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagecreatefromwbmp" xmlns="http://docbook.org/ns/docbook"> @@ -18,33 +18,6 @@ <function>imagecreatefromwbmp</function> retourne une ressource d'image PHP, représentant l'image <parameter>filename</parameter>. </para> - <para> - <function>imagecreatefromwbmp</function> retourne une chaîne vide en - cas d'erreur. Il retourne aussi un message d'erreur qui s'affiche - comme un lien mort dans un navigateur. Pour aider au déboguage, - l'exemple suivant va produire une erreur <acronym>WBMP</acronym> : - <example> - <title>Exemple de gestion des erreurs durant la création d'une image</title> - <programlisting role="php"> -<![CDATA[ -<?php -function LoadWBMP($imgname) { - $im = @imagecreatefromwbmp($imgname); /* Tentative d'ouverture */ - if (!$im) { /* Vérification que cela s'est bien passé */ - $im = imagecreatetruecolor (20, 20); /* Crée une image blanche */ - $bgc = imagecolorallocate($im, 255, 255, 255); - $tc = imagecolorallocate($im, 0, 0, 0); - imagefilledrectangle($im, 0, 0, 10, 10, $bgc); - /* Affiche le message d'erreur */ - imagestring($im, 1, 5, 5, "Erreur de chargement de $imgname", $tc); - } - return $im; -} -?> -]]> - </programlisting> - </example> - </para> &tip.fopen-wrapper; </refsect1> <refsect1 role="parameters"> @@ -55,7 +28,7 @@ <term><parameter>filename</parameter></term> <listitem> <para> - Chemin vers l'image WBMP + Chemin vers l'image WBMP. </para> </listitem> </varlistentry> @@ -69,6 +42,46 @@ &false; si une erreur survient. </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <example> + <title>Exemple de gestion d'une erreur lors du chargement d'une image WBMP</title> + <programlisting role="php"> +<![CDATA[ +<?php +function LoadWBMP($imgname) +{ + /* Tente d'ouvrir l'image */ + $im = @imagecreatefromwbmp($imgname); + + /* Traitement en cas d'échec */ + if(!$im) + { + /* Création d'une image vide */ + $im = imagecreatetruecolor (20, 20); + $bgc = imagecolorallocate($im, 255, 255, 255); + $tc = imagecolorallocate($im, 0, 0, 0); + + imagefilledrectangle($im, 0, 0, 10, 10, $bgc); + + /* On y affiche un message d'erreur */ + imagestring($im, 1, 5, 5, 'Erreur de chargement ' . $imgname, $tc); + } + + return $im; +} + +header('Content-Type: image/png'); + +$img = LoadPNG('bogus.image'); + +imagwbmp($img); +imagedestroy($img); +?> +]]> + </programlisting> + </example> + </refsect1> <refsect1 role="notes"> &reftitle.notes; &note.config.wbmp; http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecreatefromxbm.xml?r1=1.13&r2=1.14&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecreatefromxbm.xml diff -u phpdoc-fr/reference/image/functions/imagecreatefromxbm.xml:1.13 phpdoc-fr/reference/image/functions/imagecreatefromxbm.xml:1.14 --- phpdoc-fr/reference/image/functions/imagecreatefromxbm.xml:1.13 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imagecreatefromxbm.xml Sun Dec 14 10:21:09 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.13 $ --> -<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.14 $ --> +<!-- EN-Revision: 1.10 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagecreatefromxbm" xmlns="http://docbook.org/ns/docbook"> @@ -20,7 +20,6 @@ <parameter>filename</parameter>. </para> &tip.fopen-wrapper; - &warn.no-win32-fopen-wrapper; </refsect1> <refsect1 role="parameters"> &reftitle.parameters; @@ -30,7 +29,7 @@ <term><parameter>filename</parameter></term> <listitem> <para> - Chemin vers l'image XBM + Chemin vers l'image XBM. </para> </listitem> </varlistentry> @@ -44,6 +43,31 @@ &false; si une erreur survient. </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Convertie une image XBM en une image PNG en utilisant la fonction + <function>imagecreatefromxbm</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Chargement du fichier XBM +$xbm = imagecreatefromxbm('./example.xbm'); + +// On la convertie en fichier PNG +imagepng($xbm, './example.png'); +imagedestroy($xbm); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="notes"> + &reftitle.notes; + &warn.no-win32-fopen-wrapper; + </refsect1> </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecreatefromxpm.xml?r1=1.13&r2=1.14&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecreatefromxpm.xml diff -u phpdoc-fr/reference/image/functions/imagecreatefromxpm.xml:1.13 phpdoc-fr/reference/image/functions/imagecreatefromxpm.xml:1.14 --- phpdoc-fr/reference/image/functions/imagecreatefromxpm.xml:1.13 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imagecreatefromxpm.xml Sun Dec 14 10:21:09 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.13 $ --> -<!-- EN-Revision: 1.9 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.14 $ --> +<!-- EN-Revision: 1.12 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagecreatefromxpm" xmlns="http://docbook.org/ns/docbook"> @@ -29,7 +29,7 @@ <term><parameter>filename</parameter></term> <listitem> <para> - Chemin vers l'image XPM + Chemin vers l'image XPM. </para> </listitem> </varlistentry> @@ -43,10 +43,41 @@ &false; si une erreur survient. </para> </refsect1> - <refsect1 role="returnvalues"> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Création d'une instance d'image en utilisant la fonction + <function>imagecreatefromxpm</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Vérifie le support XPM +if(!(imagetypes() & IMG_XPM)) +{ + die('Le support XPM n\'a pu être vérifié !'); +} + +// Création de l'instance d'une image +$xpm = imagecreatefromxpm('./example.xpm'); + +// Quelques opérations sur l'image ici + +// PHP n'a pas le support pour l'écriture des images XPM +// aussi, dans ce cas, nous sauvegardons l'image dans un fichier JPEG +// avec une qualité de 100% +imagejpeg($im, './example.jpg', 100); +imagedestroy($im); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="notes"> &reftitle.returnvalues; &note.bundled.gd; - &warn.no-win32-fopen-wrapper; + &note.no-windows; </refsect1> </refentry> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecreatetruecolor.xml?r1=1.20&r2=1.21&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecreatetruecolor.xml diff -u phpdoc-fr/reference/image/functions/imagecreatetruecolor.xml:1.20 phpdoc-fr/reference/image/functions/imagecreatetruecolor.xml:1.21 --- phpdoc-fr/reference/image/functions/imagecreatetruecolor.xml:1.20 Sat Jun 21 20:51:34 2008 +++ phpdoc-fr/reference/image/functions/imagecreatetruecolor.xml Sun Dec 14 10:21:09 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.20 $ --> -<!-- EN-Revision: 1.14 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.21 $ --> +<!-- EN-Revision: 1.16 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagecreatetruecolor" xmlns="http://docbook.org/ns/docbook"> @@ -20,11 +20,13 @@ représentant une image noire. </para> <para> - Suivant votre version de PHP et de GD, cette fonction est définie ou non. De PHP version - 4.0.6 à la version 4.1.x, cette fonction existe toujours si le module GD est chargé, mais l'appeler - sans avoir GD2 d'installé fera que PHP lancera une erreur fatale et sortira. Avec PHP 4.2.x, - ce comportement est différent et PHP lancera une alerte au lieu d'une erreur. Pour les autres versions - de PHP, cette fonction n'est définie que si une version correcte de GD est installée. + Suivant votre version de PHP et de GD, cette fonction est définie ou non. + De PHP version 4.0.6 à la version 4.1.x, cette fonction existe toujours si + le module GD est chargé, mais l'appeler sans avoir GD2 d'installé fera que + PHP lancera une erreur fatale et sortira. Avec PHP 4.2.x, ce comportement + est différent et PHP lancera une alerte au lieu d'une erreur. Pour les + autres versions de PHP, cette fonction n'est définie que si une version + correcte de GD est installée. </para> </refsect1> <refsect1 role="parameters"> @@ -35,7 +37,7 @@ <term><parameter>width</parameter></term> <listitem> <para> - Largeur de l'image + Largeur de l'image. </para> </listitem> </varlistentry> @@ -43,7 +45,7 @@ <term><parameter>height</parameter></term> <listitem> <para> - Hauteur de l'image + Hauteur de l'image. </para> </listitem> </varlistentry> @@ -67,11 +69,11 @@ <programlisting role="php"> <![CDATA[ <?php -header ("Content-type: image/png"); +header ('Content-type: image/png'); $im = @imagecreatetruecolor(120, 20) - or die("Impossible de crée un flux d'image GD"); + or die('Impossible de crée un flux d\'image GD'); $text_color = imagecolorallocate($im, 233, 14, 91); -imagestring($im, 1, 5, 5, "Une simple chaîne de texte", $text_color); +imagestring($im, 1, 5, 5, 'Une simple chaîne de texte', $text_color); imagepng($im); imagedestroy($im); ?> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagecreate.xml?r1=1.18&r2=1.19&diff_format=u Index: phpdoc-fr/reference/image/functions/imagecreate.xml diff -u phpdoc-fr/reference/image/functions/imagecreate.xml:1.18 phpdoc-fr/reference/image/functions/imagecreate.xml:1.19 --- phpdoc-fr/reference/image/functions/imagecreate.xml:1.18 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imagecreate.xml Sun Dec 14 10:21:09 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.18 $ --> -<!-- EN-Revision: 1.12 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.19 $ --> +<!-- EN-Revision: 1.13 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagecreate" xmlns="http://docbook.org/ns/docbook"> @@ -32,7 +32,7 @@ <term><parameter>width</parameter></term> <listitem> <para> - La largeur de l'image + La largeur de l'image. </para> </listitem> </varlistentry> @@ -40,7 +40,7 @@ <term><parameter>height</parameter></term> <listitem> <para> - La hauteur de l'image + La hauteur de l'image. </para> </listitem> </varlistentry> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagedashedline.xml?r1=1.14&r2=1.15&diff_format=u Index: phpdoc-fr/reference/image/functions/imagedashedline.xml diff -u phpdoc-fr/reference/image/functions/imagedashedline.xml:1.14 phpdoc-fr/reference/image/functions/imagedashedline.xml:1.15 --- phpdoc-fr/reference/image/functions/imagedashedline.xml:1.14 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imagedashedline.xml Sun Dec 14 10:21:09 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.14 $ --> -<!-- EN-Revision: 1.8 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.15 $ --> +<!-- EN-Revision: 1.13 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagedashedline" xmlns="http://docbook.org/ns/docbook"> @@ -25,6 +25,135 @@ <function>imageline</function>. </para> </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + &gd.image.description; + <varlistentry> + <term><parameter>x1</parameter></term> + <listitem> + <para> + Coordonnée en X : En haut, à gauche. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>y1</parameter></term> + <listitem> + <para> + Coordonnée en Y : En haut, à gauche. 0 est le coin en haut à gauche + de l'image. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>x2</parameter></term> + <listitem> + <para> + Coordonnée en X : En bas, à droite. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>y2</parameter></term> + <listitem> + <para> + Coordonnée en Y : En bas, à droite. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>color</parameter></term> + <listitem> + <para> + La couleur de remplissage. Un identifiant de couleur + retourné par la fonction <function>imagecolorallocate</function>. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Retourne toujours &true;. + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemple avec <function>imagedashedline</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Crée une image de 100x100 pixels +$im = imagecreatetruecolor(100, 100); +$white = imagecolorallocate($im, 0xFF, 0xFF, 0xFF); + +// Dessine une ligne verticale en pointillé +imagedashedline($im, 50, 25, 50, 75, $white); + +// Sauvegarde l'image +imagepng($im, './dashedline.png'); +imagedestroy($im); +?> +]]> + </programlisting> + &example.outputs.similar; + <mediaobject> + <imageobject> + <imagedata fileref="figures/image.imagedashedline.png"/> + </imageobject> + </mediaobject> + </example> + <example> + <title>Alternative à la fonction <function>imagedashedline</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Crée une image de 100x100 pixels +$im = imagecreatetruecolor(100, 100); +$white = imagecolorallocate($im, 0xFF, 0xFF, 0xFF); + +// Définit le style : Les 4 premiers pixels sont blancs et les 4 suivants +// sont transparents. Ceci va créer l'effet de pointillé +$style = Array( + $white, + $white, + $white, + $white, + IMG_COLOR_TRANSPARENT, + IMG_COLOR_TRANSPARENT, + IMG_COLOR_TRANSPARENT, + IMG_COLOR_TRANSPARENT + ); + +imagesetstyle($im, $style); + +// Dessine la ligne pointillée +imageline($im, 50, 25, 50, 75, IMG_COLOR_STYLED); + +// Sauvegarde de l'image +imagepng($im, './imageline.png'); +imagedestroy($im); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>imagesetstyle</function></member> + <member><function>imageline</function></member> + </simplelist> + </para> + </refsect1> </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagedestroy.xml?r1=1.15&r2=1.16&diff_format=u Index: phpdoc-fr/reference/image/functions/imagedestroy.xml diff -u phpdoc-fr/reference/image/functions/imagedestroy.xml:1.15 phpdoc-fr/reference/image/functions/imagedestroy.xml:1.16 --- phpdoc-fr/reference/image/functions/imagedestroy.xml:1.15 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imagedestroy.xml Sun Dec 14 10:21:09 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.15 $ --> -<!-- EN-Revision: 1.8 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.16 $ --> +<!-- EN-Revision: 1.9 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagedestroy" xmlns="http://docbook.org/ns/docbook"> @@ -33,6 +33,27 @@ &return.success; </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemple avec <function>imagedestroy</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Crée une image de 100 x 100 pixels +$im = imagecreatetruecolor(100, 100); + +// Modification et/ou sauvegarde de l'image + +// Libération de la mémoire associée +imagedestroy($im); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imageellipse.xml?r1=1.17&r2=1.18&diff_format=u Index: phpdoc-fr/reference/image/functions/imageellipse.xml diff -u phpdoc-fr/reference/image/functions/imageellipse.xml:1.17 phpdoc-fr/reference/image/functions/imageellipse.xml:1.18 --- phpdoc-fr/reference/image/functions/imageellipse.xml:1.17 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imageellipse.xml Sun Dec 14 10:21:09 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.17 $ --> -<!-- EN-Revision: 1.13 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.18 $ --> +<!-- EN-Revision: 1.15 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imageellipse" xmlns="http://docbook.org/ns/docbook"> @@ -32,7 +32,7 @@ <term><parameter>cx</parameter></term> <listitem> <para> - X : coordonnée du centre + X : coordonnée du centre. </para> </listitem> </varlistentry> @@ -40,7 +40,7 @@ <term><parameter>cy</parameter></term> <listitem> <para> - Y : coordonnée du centre + Y : coordonnée du centre. </para> </listitem> </varlistentry> @@ -48,7 +48,7 @@ <term><parameter>width</parameter></term> <listitem> <para> - La largeur de l'ellipse + La largeur de l'ellipse. </para> </listitem> </varlistentry> @@ -56,7 +56,7 @@ <term><parameter>height</parameter></term> <listitem> <para> - La hauteur de l'ellipse + La hauteur de l'ellipse. </para> </listitem> </varlistentry> @@ -65,7 +65,7 @@ <listitem> <para> La couleur de l'ellipse. Un identifiant de couleur créé avec - la fonction <function>imagecolorallocate</function> + la fonction <function>imagecolorallocate</function>. </para> </listitem> </varlistentry> @@ -86,14 +86,16 @@ <programlisting role="php"> <![CDATA[ <?php - -// Nouvelle image +// Création d'une image vide $image = imagecreatetruecolor(400, 300); -// Remplissage du fond +// Choix de la couleur d'arrière-plan $bg = imagecolorallocate($image, 0, 0, 0); -// Couleur de l'ellipse +// Remplit l'arrière-plan avec la couleur sélectionnée +imagefill($image, 0, 0, $bg); + +// Choix de la couleur de l'ellipse $col_ellipse = imagecolorallocate($image, 255, 255, 255); // On dessine l'ellipse http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagefilledarc.xml?r1=1.20&r2=1.21&diff_format=u Index: phpdoc-fr/reference/image/functions/imagefilledarc.xml diff -u phpdoc-fr/reference/image/functions/imagefilledarc.xml:1.20 phpdoc-fr/reference/image/functions/imagefilledarc.xml:1.21 --- phpdoc-fr/reference/image/functions/imagefilledarc.xml:1.20 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imagefilledarc.xml Sun Dec 14 10:21:09 2008 @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.20 $ --> -<!-- EN-Revision: 1.13 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.21 $ --> +<!-- EN-Revision: 1.14 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagefilledarc" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>imagefilledarc</refname> - <refpurpose>Dessine une ellipse partielle et la remplit</refpurpose> + <refpurpose>Dessine un arc partiel et le remplit</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; @@ -23,7 +23,7 @@ <methodparam><type>int</type><parameter>style</parameter></methodparam> </methodsynopsis> <para> - Dessine une ellipse partielle, centrée aux coordonnées spécifiées dans + Dessine un arc partiel, centré aux coordonnées spécifiées dans l'image fournie. </para> </refsect1> @@ -36,7 +36,7 @@ <term><parameter>cx</parameter></term> <listitem> <para> - X : coordonnée du centre + X : coordonnée du centre. </para> </listitem> </varlistentry> @@ -44,7 +44,7 @@ <term><parameter>cy</parameter></term> <listitem> <para> - Y : coordonnée du centre + Y : coordonnée du centre. </para> </listitem> </varlistentry> @@ -52,7 +52,7 @@ <term><parameter>width</parameter></term> <listitem> <para> - La largeur de l'arc + La largeur de l'arc. </para> </listitem> </varlistentry> @@ -60,7 +60,7 @@ <term><parameter>height</parameter></term> <listitem> <para> - La hauteur de l'arc + La hauteur de l'arc. </para> </listitem> </varlistentry> @@ -68,7 +68,7 @@ <term><parameter>start</parameter></term> <listitem> <para> - L'angle de début de l'arc, en degrés + L'angle de début de l'arc, en degrés. </para> </listitem> </varlistentry> @@ -87,7 +87,7 @@ <listitem> <para> Un identifiant de couleur, créé par la fonction - <function>imagecolorallocate</function> + <function>imagecolorallocate</function>. </para> </listitem> </varlistentry> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagefilledellipse.xml?r1=1.19&r2=1.20&diff_format=u Index: phpdoc-fr/reference/image/functions/imagefilledellipse.xml diff -u phpdoc-fr/reference/image/functions/imagefilledellipse.xml:1.19 phpdoc-fr/reference/image/functions/imagefilledellipse.xml:1.20 --- phpdoc-fr/reference/image/functions/imagefilledellipse.xml:1.19 Sat May 3 15:53:24 2008 +++ phpdoc-fr/reference/image/functions/imagefilledellipse.xml Sun Dec 14 10:21:09 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.19 $ --> -<!-- EN-Revision: 1.17 Maintainer: jsgoupil Status: ready --> +<!-- $Revision: 1.20 $ --> +<!-- EN-Revision: 1.18 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagefilledellipse" xmlns="http://docbook.org/ns/docbook"> @@ -32,7 +32,7 @@ <term><parameter>cx</parameter></term> <listitem> <para> - X : coordonnée du centre + X : coordonnée du centre. </para> </listitem> </varlistentry> @@ -40,7 +40,7 @@ <term><parameter>cy</parameter></term> <listitem> <para> - Y : coordonnée du centre + Y : coordonnée du centre. </para> </listitem> </varlistentry> @@ -48,7 +48,7 @@ <term><parameter>width</parameter></term> <listitem> <para> - La largeur de l'ellipse + La largeur de l'ellipse. </para> </listitem> </varlistentry> @@ -56,7 +56,7 @@ <term><parameter>height</parameter></term> <listitem> <para> - La hauteur de l'ellipse + La hauteur de l'ellipse. </para> </listitem> </varlistentry> @@ -65,7 +65,7 @@ <listitem> <para> La couleur de remplissage. Un identifiant de couleur - créé par la fonction <function>imagecolorallocate</function> + créé par la fonction <function>imagecolorallocate</function>. </para> </listitem> </varlistentry> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagefilledpolygon.xml?r1=1.17&r2=1.18&diff_format=u Index: phpdoc-fr/reference/image/functions/imagefilledpolygon.xml diff -u phpdoc-fr/reference/image/functions/imagefilledpolygon.xml:1.17 phpdoc-fr/reference/image/functions/imagefilledpolygon.xml:1.18 --- phpdoc-fr/reference/image/functions/imagefilledpolygon.xml:1.17 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imagefilledpolygon.xml Sun Dec 14 10:21:09 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.17 $ --> -<!-- EN-Revision: 1.13 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.18 $ --> +<!-- EN-Revision: 1.15 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagefilledpolygon" xmlns="http://docbook.org/ns/docbook"> @@ -50,7 +50,7 @@ <listitem> <para> Un identifiant de couleur, créé par la fonction - <function>imagecolorallocate</function> + <function>imagecolorallocate</function>. </para> </listitem> </varlistentry> @@ -84,10 +84,13 @@ // Création d'une image $image = imagecreatetruecolor(250, 250); -// Quelques couleurs +// Alloue quelques couleurs $bg = imagecolorallocate($image, 200, 200, 200); $blue = imagecolorallocate($image, 0, 0, 255); +// Remplit l'arrière-plan +imagefilledrectangle($image, 0, 0, 249, 249, $bg); + // Dessine le polygone imagefilledpolygon($image, $values, 6, $blue); http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagefilledrectangle.xml?r1=1.14&r2=1.15&diff_format=u Index: phpdoc-fr/reference/image/functions/imagefilledrectangle.xml diff -u phpdoc-fr/reference/image/functions/imagefilledrectangle.xml:1.14 phpdoc-fr/reference/image/functions/imagefilledrectangle.xml:1.15 --- phpdoc-fr/reference/image/functions/imagefilledrectangle.xml:1.14 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imagefilledrectangle.xml Sun Dec 14 10:21:09 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.14 $ --> -<!-- EN-Revision: 1.8 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.15 $ --> +<!-- EN-Revision: 1.10 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagefilledrectangle" xmlns="http://docbook.org/ns/docbook"> @@ -35,7 +35,7 @@ <term><parameter>x1</parameter></term> <listitem> <para> - X : coordonné du point 1 + X : coordonné du point 1. </para> </listitem> </varlistentry> @@ -43,7 +43,7 @@ <term><parameter>y1</parameter></term> <listitem> <para> - Y : coordonné du point 1 + Y : coordonné du point 1. </para> </listitem> </varlistentry> @@ -51,7 +51,7 @@ <term><parameter>x2</parameter></term> <listitem> <para> - X : coordonné du point 2 + X : coordonné du point 2. </para> </listitem> </varlistentry> @@ -59,7 +59,7 @@ <term><parameter>y2</parameter></term> <listitem> <para> - Y : coordonné du point 2 + Y : coordonné du point 2. </para> </listitem> </varlistentry> @@ -68,7 +68,7 @@ <listitem> <para> La couleur de remplissage. Un identifiant de couleur - créé par la fonction <function>imagecolorallocate</function> + créé par la fonction <function>imagecolorallocate</function>. </para> </listitem> </varlistentry> @@ -81,6 +81,36 @@ &return.success; </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemple avec <function>imagefilledrectangle</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Création d'une image de 55x30 pixels +$im = imagecreatetruecolor(55, 30); +$white = imagecolorallocate($im, 255, 255, 255); + +// Dessine un rectangle blanc +imagefilledrectangle($im, 4, 4, 50, 25, $white); + +// Sauvegarde l'image +imagepng($im, './imagefilledrectangle.png'); +imagedestroy($im); +?> +]]> + </programlisting> + &example.outputs.similar; + <mediaobject> + <imageobject> + <imagedata fileref="figures/image.imagefilledrectangle.png"/> + </imageobject> + </mediaobject> + </example> + </para> + </refsect1> </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/image/functions/imagefilltoborder.xml?r1=1.14&r2=1.15&diff_format=u Index: phpdoc-fr/reference/image/functions/imagefilltoborder.xml diff -u phpdoc-fr/reference/image/functions/imagefilltoborder.xml:1.14 phpdoc-fr/reference/image/functions/imagefilltoborder.xml:1.15 --- phpdoc-fr/reference/image/functions/imagefilltoborder.xml:1.14 Sun Jul 22 19:39:24 2007 +++ phpdoc-fr/reference/image/functions/imagefilltoborder.xml Sun Dec 14 10:21:09 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.14 $ --> -<!-- EN-Revision: 1.8 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.15 $ --> +<!-- EN-Revision: 1.10 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.imagefilltoborder" xmlns="http://docbook.org/ns/docbook"> @@ -36,7 +36,7 @@ <term><parameter>x</parameter></term> <listitem> <para> - X : coordonné de départ + X : coordonné de départ. </para> </listitem> </varlistentry> @@ -44,7 +44,7 @@ <term><parameter>y</parameter></term> <listitem> <para> - Y : coordonné de départ + Y : coordonné de départ. </para> </listitem> </varlistentry> @@ -53,7 +53,7 @@ <listitem> <para> La couleur de la bordure. Un identifiant de couleur - créé par la fonction <function>imagecolorallocate</function> + créé par la fonction <function>imagecolorallocate</function>. </para> </listitem> </varlistentry> @@ -62,7 +62,7 @@ <listitem> <para> La couleur de remplissage. Un identifiant de couleur - créé par la fonction <function>imagecolorallocate</function> + créé par la fonction <function>imagecolorallocate</function>. </para> </listitem> </varlistentry> @@ -75,6 +75,45 @@ &return.success; </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Remplissage d'un ellipse avec une couleur</title> + <programlisting role="php"> +<![CDATA[ +<?php +// Création d'un gestionnaire d'image, puis définit la couleur d'arrière-plan +// à blanc +$im = imagecreatetruecolor(100, 100); +imagefilledrectangle($im, 0, 0, 100, 100, imagecolorallocate($im, 255, 255, 255)); + +// Dessine une ellipse dont les bordures seront noires +imageellipse($im, 50, 50, 50, 50, imagecolorallocate($im, 0, 0, 0)); + +// Définit la bordure et remplit l'ellipse de la couleur choisie +$border = imagecolorallocate($im, 0, 0, 0); +$fill = imagecolorallocate($im, 255, 0, 0); + +// Remplit la sélection +imagefilltoborder($im, 50, 50, $border, $fill); + +// Affichage et libération de la mémoire +header('Content-type: image/png'); +imagepng($im); +imagedestroy($im); +?> +]]> + </programlisting> + &example.outputs.similar; + <mediaobject> + <imageobject> + <imagedata fileref="figures/image.imagefilltoborder.png" /> + </imageobject> + </mediaobject> + </example> + </para> + </refsect1> </refentry> <!-- Keep this comment at the end of the file
« previous php.doc.fr (#6157) next »