<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.image.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.imagesetstyle.php',
    1 => 'imagesetstyle',
    2 => 'Configure le style pour le dessin des lignes',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'Fonctions GD et images',
  ),
  'prev' => 
  array (
    0 => 'function.imagesetpixel.php',
    1 => 'imagesetpixel',
  ),
  'next' => 
  array (
    0 => 'function.imagesetthickness.php',
    1 => 'imagesetthickness',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/image/functions/imagesetstyle.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imagesetstyle" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagesetstyle</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imagesetstyle</span> &mdash; <span class="dc-title">Configure le style pour le dessin des lignes</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imagesetstyle-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagesetstyle</strong></span>(<span class="methodparam"><span class="type"><a href="class.gdimage.php" class="type GdImage">GdImage</a></span> <code class="parameter">$image</code></span>, <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$style</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>imagesetstyle()</strong></span> permet de choisir le style à utiliser
   lors du dessin des lignes (comme avec les fonctions <span class="function"><a href="function.imageline.php" class="function">imageline()</a></span>
   et <span class="function"><a href="function.imagepolygon.php" class="function">imagepolygon()</a></span>) lors de l&#039;utilisation de la 
   couleur spéciale <strong><code><a href="image.constants.php#constant.img-color-styled">IMG_COLOR_STYLED</a></code></strong> ou bien lors du 
   dessin de lignes avec la couleur <strong><code><a href="image.constants.php#constant.img-color-styledbrushed">IMG_COLOR_STYLEDBRUSHED</a></code></strong>.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imagesetstyle-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
<dt><code class="parameter">image</code></dt><dd><p class="para">
 Un objet <span class="classname"><a href="class.gdimage.php" class="classname">GdImage</a></span>, retournée par une des fonctions de
 création d&#039;images, comme <span class="function"><a href="function.imagecreatetruecolor.php" class="function">imagecreatetruecolor()</a></span>.
</p></dd>
    
     <dt><code class="parameter">style</code></dt>
     <dd>
      <p class="para">
       Un tableau de couleurs de pixels. Il est possible d&#039;utiliser la constante
       <strong><code><a href="image.constants.php#constant.img-color-transparent">IMG_COLOR_TRANSPARENT</a></code></strong> pour ajouter
       un pixel transparent.
       Il est à noter que <code class="parameter">style</code> ne doit pas être un tableau <span class="type"><a href="language.types.array.php" class="type array">array</a></span> vide.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imagesetstyle-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Cette fonction retourne <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> en cas de succès ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si une erreur survient.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.imagesetstyle-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   L&#039;exemple suivant dessine une ligne pointillée depuis le coin supérieur
   gauche vers le coin inférieur droit de l&#039;image :
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple pour <span class="function"><strong>imagesetstyle()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />header</span><span style="color: #007700">(</span><span style="color: #DD0000">"Content-type: image/jpeg"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$im  </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecreatetruecolor</span><span style="color: #007700">(</span><span style="color: #0000BB">100</span><span style="color: #007700">, </span><span style="color: #0000BB">100</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$w   </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$red </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* Dessine une ligne pointillée de 5 pixels rouges, 5 pixels blancs */<br /></span><span style="color: #0000BB">$style </span><span style="color: #007700">= array(</span><span style="color: #0000BB">$red</span><span style="color: #007700">, </span><span style="color: #0000BB">$red</span><span style="color: #007700">, </span><span style="color: #0000BB">$red</span><span style="color: #007700">, </span><span style="color: #0000BB">$red</span><span style="color: #007700">, </span><span style="color: #0000BB">$red</span><span style="color: #007700">, </span><span style="color: #0000BB">$w</span><span style="color: #007700">, </span><span style="color: #0000BB">$w</span><span style="color: #007700">, </span><span style="color: #0000BB">$w</span><span style="color: #007700">, </span><span style="color: #0000BB">$w</span><span style="color: #007700">, </span><span style="color: #0000BB">$w</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagesetstyle</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">$style</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imageline</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">100</span><span style="color: #007700">, </span><span style="color: #0000BB">100</span><span style="color: #007700">, </span><span style="color: #0000BB">IMG_COLOR_STYLED</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* Dessine une ligne avec des smileys, en utilisant imagesetbrush() et imagesetstyle */<br /></span><span style="color: #0000BB">$style </span><span style="color: #007700">= array(</span><span style="color: #0000BB">$w</span><span style="color: #007700">, </span><span style="color: #0000BB">$w</span><span style="color: #007700">, </span><span style="color: #0000BB">$w</span><span style="color: #007700">, </span><span style="color: #0000BB">$w</span><span style="color: #007700">, </span><span style="color: #0000BB">$w</span><span style="color: #007700">, </span><span style="color: #0000BB">$w</span><span style="color: #007700">, </span><span style="color: #0000BB">$w</span><span style="color: #007700">, </span><span style="color: #0000BB">$w</span><span style="color: #007700">, </span><span style="color: #0000BB">$w</span><span style="color: #007700">, </span><span style="color: #0000BB">$w</span><span style="color: #007700">, </span><span style="color: #0000BB">$w</span><span style="color: #007700">, </span><span style="color: #0000BB">$w</span><span style="color: #007700">, </span><span style="color: #0000BB">$red</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagesetstyle</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">$style</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$brush </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecreatefrompng</span><span style="color: #007700">(</span><span style="color: #DD0000">"http://www.libpng.org/pub/png/images/smile.happy.png"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$w2 </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$brush</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagecolortransparent</span><span style="color: #007700">(</span><span style="color: #0000BB">$brush</span><span style="color: #007700">, </span><span style="color: #0000BB">$w2</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagesetbrush</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">$brush</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imageline</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">100</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">100</span><span style="color: #007700">, </span><span style="color: #0000BB">IMG_COLOR_STYLEDBRUSHED</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">imagejpeg</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Résultat de l&#039;exemple ci-dessus est similaire à :</p></div>
    <div class="mediaobject">
     
     <div class="imageobject">
      <img src="images/21009b70229598c6a80eef8b45bf282b-imagesetstyle.jpg" alt="Affichage de l'exemple : imagesetstyle()" width="100" height="100" />
     </div>
    </div>
   </div>
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.imagesetstyle-seealso">
  <h3 class="title">Voir aussi</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.imagesetbrush.php" class="function" rel="rdfs-seeAlso">imagesetbrush()</a> - Modifie la brosse pour le dessin des lignes</span></li>
   <li><span class="function"><a href="function.imageline.php" class="function" rel="rdfs-seeAlso">imageline()</a> - Dessine une ligne</span></li>
  </ul>
 </div>

</div><?php manual_footer($setup); ?>