mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-26 01:42:09 +01:00
125 lines
3.9 KiB
XML
Executable File
125 lines
3.9 KiB
XML
Executable File
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 593ea510e853ff034e03f78a4be0daa41661c9d4 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
|
|
<refentry xml:id="function.imagesetstyle" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>imagesetstyle</refname>
|
|
<refpurpose>Configure le style pour le dessin des lignes</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>imagesetstyle</methodname>
|
|
<methodparam><type>GdImage</type><parameter>image</parameter></methodparam>
|
|
<methodparam><type>array</type><parameter>style</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>imagesetstyle</function> permet de choisir le style à utiliser
|
|
lors du dessin des lignes (comme avec les fonctions <function>imageline</function>
|
|
et <function>imagepolygon</function>) lors de l'utilisation de la
|
|
couleur spéciale <constant>IMG_COLOR_STYLED</constant> ou bien lors du
|
|
dessin de lignes avec la couleur <constant>IMG_COLOR_STYLEDBRUSHED</constant>.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
&gd.image.description;
|
|
<varlistentry>
|
|
<term><parameter>style</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Un tableau de couleurs de pixels. Vous pouvez utiliser la constante
|
|
<constant>IMG_COLOR_TRANSPARENT</constant> pour ajouter
|
|
un pixel transparent.
|
|
Notez que <parameter>style</parameter> ne doit pas être un tableau <type>array</type> vide.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
L'exemple suivant dessine une ligne pointillée depuis le coin supérieur
|
|
gauche vers le coin inférieur droit de l'image :
|
|
<example>
|
|
<title>Exemple pour <function>imagesetstyle</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
header("Content-type: image/jpeg");
|
|
$im = imagecreatetruecolor(100, 100);
|
|
$w = imagecolorallocate($im, 255, 255, 255);
|
|
$red = imagecolorallocate($im, 255, 0, 0);
|
|
|
|
/* Dessine une ligne pointillée de 5 pixels rouges, 5 pixels blancs */
|
|
$style = array($red, $red, $red, $red, $red, $w, $w, $w, $w, $w);
|
|
imagesetstyle($im, $style);
|
|
imageline($im, 0, 0, 100, 100, IMG_COLOR_STYLED);
|
|
|
|
/* Dessine une ligne avec des smileys, en utilisant imagesetbrush() et imagesetstyle */
|
|
$style = array($w, $w, $w, $w, $w, $w, $w, $w, $w, $w, $w, $w, $red);
|
|
imagesetstyle($im, $style);
|
|
|
|
$brush = imagecreatefrompng("http://www.libpng.org/pub/png/images/smile.happy.png");
|
|
$w2 = imagecolorallocate($brush, 255, 255, 255);
|
|
imagecolortransparent($brush, $w2);
|
|
imagesetbrush($im, $brush);
|
|
imageline($im, 100, 0, 0, 100, IMG_COLOR_STYLEDBRUSHED);
|
|
|
|
imagejpeg($im);
|
|
imagedestroy($im);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<mediaobject>
|
|
<alt>Affichage de l'exemple : imagesetstyle()</alt>
|
|
<imageobject>
|
|
<imagedata fileref="en/reference/image/figures/imagesetstyle.jpg"/>
|
|
</imageobject>
|
|
</mediaobject>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<simplelist>
|
|
<member><function>imagesetbrush</function></member>
|
|
<member><function>imageline</function></member>
|
|
</simplelist>
|
|
</refsect1>
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|