<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.imagerotate" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>imagerotate</refname>
  <refpurpose>Rotate an image with a given angle</refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type class="union"><type>GdImage</type><type>false</type></type><methodname>imagerotate</methodname>
   <methodparam><type>GdImage</type><parameter>image</parameter></methodparam>
   <methodparam><type>float</type><parameter>angle</parameter></methodparam>
   <methodparam><type>int</type><parameter>background_color</parameter></methodparam>
  </methodsynopsis>
  <para>
   Rotates the <parameter>image</parameter> image using the given
   <parameter>angle</parameter> in degrees. 
  </para>
  <para>
   The center of rotation is the center of the image, and the rotated
   image may have different dimensions than the original image.
  </para>
 </refsect1>
 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    &gd.image.description;
    <varlistentry>
     <term><parameter>angle</parameter></term>
     <listitem>
      <para>
       Rotation angle, in degrees. The rotation angle is interpreted as the
       number of degrees to rotate the image anticlockwise.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>background_color</parameter></term>
     <listitem>
      <para>
       Specifies the color of the uncovered zone after the rotation
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>
 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns an image object for the rotated image, &return.falseforfailure;.
  </para>
 </refsect1>

 <refsect1 role="changelog">
  &reftitle.changelog;
  <informaltable>
   <tgroup cols="2">
    <thead>
     <row>
      <entry>&Version;</entry>
      <entry>&Description;</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry>8.3.0</entry>
      <entry>
       The unused <parameter>ignore_transparent</parameter> has been completely removed.
      </entry>
     </row>
     <row>
      <entry>8.0.0</entry>
      <entry>
       On success, this function returns a <classname>GDImage</classname> instance now;
       previously, a <type>resource</type> was returned.
      </entry>
     </row>
     &gd.changelog.image-param;
     <row>
      <entry>8.0.0</entry>
      <entry>
       The unused <parameter>ignore_transparent</parameter> expects a <type>bool</type> now;
       previously it expected an <type>int</type>.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </informaltable>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title>Rotate an image 180 degrees</title>
    <para>
     This example rotates an image 180 degrees - upside down.
    </para>
    <programlisting role="php">
<![CDATA[
<?php
// File and rotation
$filename = 'test.jpg';
$degrees = 180;

// Content type
header('Content-type: image/jpeg');

// Load
$source = imagecreatefromjpeg($filename);

// Rotate
$rotate = imagerotate($source, $degrees, 0);

// Output
imagejpeg($rotate);

// Free the memory
imagedestroy($source);
imagedestroy($rotate);
?>
]]>
    </programlisting>
    &example.outputs.similar;
    <mediaobject>
     <alt>Output of example : Rotate an image 180 degrees</alt>
     <imageobject>
      <imagedata fileref="en/reference/image/figures/imagerotate.jpg"/>
     </imageobject>
    </mediaobject>
   </example>
  </para>
 </refsect1>
 <refsect1 role="notes">
  &reftitle.notes;
  &note.gd.interpolation;
 </refsect1>
 <refsect1 role="seealso">
  &reftitle.seealso;
  <simplelist>
   <member><function>imagesetinterpolation</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
-->
