<?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.imagerotate.php',
    1 => 'imagerotate',
    2 => 'Fait tourner une image d\'un angle',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'Fonctions GD et images',
  ),
  'prev' => 
  array (
    0 => 'function.imageresolution.php',
    1 => 'imageresolution',
  ),
  'next' => 
  array (
    0 => 'function.imagesavealpha.php',
    1 => 'imagesavealpha',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/image/functions/imagerotate.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imagerotate" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagerotate</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imagerotate</span> &mdash; <span class="dc-title">Fait tourner une image d&#039;un angle</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imagerotate-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagerotate</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.float.php" class="type float">float</a></span> <code class="parameter">$angle</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$background_color</code></span>): <span class="type"><span class="type"><a href="class.gdimage.php" class="type GdImage">GdImage</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>imagerotate()</strong></span> fait tourner l&#039;image <code class="parameter">image</code> 
   d&#039;un angle de <code class="parameter">angle</code>, en degrés.
  </p>
  <p class="para">
   Le centre de rotation est le centre de l&#039;image, et l&#039;image tournée peut avoir
   des dimensions différentes de l&#039;image originale.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imagerotate-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">angle</code></dt>
     <dd>
      <p class="para">
       L&#039;angle de rotation, en degrés. L&#039;angle de rotation est
       interprété comme étant le nombre de degrés à tourner l&#039;image
       dans le sens inverse des aiguilles d&#039;une montre.
      </p>
     </dd>
    
    
     <dt><code class="parameter">background_color</code></dt>
     <dd>
      <p class="para">
       Spécifie la couleur des zones qui seront découvertes après la rotation.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imagerotate-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne un objet d&#039;image correspondant à l&#039;image
   après rotation,  ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si une erreur survient.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imagerotate-changelog">
  <h3 class="title">Historique</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.3.0</td>
      <td>
       Le paramètre inutilisé <code class="parameter">ignore_transparent</code> a été complètement supprimé.
      </td>
     </tr>

     <tr>
      <td>8.0.0</td>
      <td>
       En cas de succès, cette fonction retourne désormais une instance de
       <span class="classname"><a href="class.gdimage.php" class="classname">GDImage</a></span> ; auparavant,
       une <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> était retournée.
      </td>
     </tr>

     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">image</code> attend une instance de <span class="classname"><a href="class.gdimage.php" class="classname">GdImage</a></span> désormais;
  auparavant, une <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="literal">gd</code> était attendue.
 </td>
</tr>

     <tr>
      <td>8.0.0</td>
      <td>
       Le paramètre inutilisé <code class="parameter">ignore_transparent</code> attend désormais un <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> ;
       auparavant il s&#039;attendait à un <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>

 
 <div class="refsect1 examples" id="refsect1-function.imagerotate-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Rotation d&#039;une image de 180 degrés</strong></p>
    <div class="example-contents"><p>
     Cet exemple tourne une image de 180 degrés - à l&#039;envers.
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// Fichier et degrés de rotation<br /></span><span style="color: #0000BB">$filename </span><span style="color: #007700">= </span><span style="color: #DD0000">'test.jpg'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$degrees </span><span style="color: #007700">= </span><span style="color: #0000BB">180</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Content type<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-type: image/jpeg'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Chargement<br /></span><span style="color: #0000BB">$source </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecreatefromjpeg</span><span style="color: #007700">(</span><span style="color: #0000BB">$filename</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Rotation<br /></span><span style="color: #0000BB">$rotate </span><span style="color: #007700">= </span><span style="color: #0000BB">imagerotate</span><span style="color: #007700">(</span><span style="color: #0000BB">$source</span><span style="color: #007700">, </span><span style="color: #0000BB">$degrees</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Affichage<br /></span><span style="color: #0000BB">imagejpeg</span><span style="color: #007700">(</span><span style="color: #0000BB">$rotate</span><span style="color: #007700">);<br /><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-imagerotate.jpg" alt="Affichage de l'exemple : Rotation d'une image de 180 degrés" width="95" height="51" />
     </div>
    </div>
   </div>
  </p>
 </div>

 
 <div class="refsect1 notes" id="refsect1-function.imagerotate-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para">Cette fonction est affectée par
    la méthode d&#039;interpolation, définie par la fonction <span class="function"><a href="function.imagesetinterpolation.php" class="function">imagesetinterpolation()</a></span>.</p></p></blockquote>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.imagerotate-seealso">
  <h3 class="title">Voir aussi</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.imagesetinterpolation.php" class="function" rel="rdfs-seeAlso">imagesetinterpolation()</a> - D&eacute;finit la m&eacute;thode d'interpolation</span></li>
  </ul>
 </div>

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