aidan Mon Oct 4 03:09:49 2004 EDT
Modified files:
/phpdoc/en/reference/image/functions imagerotate.xml
Log:
Added example
http://cvs.php.net/diff.php/phpdoc/en/reference/image/functions/imagerotate.xml?r1=1.4&r2=1.5&ty=u
Index: phpdoc/en/reference/image/functions/imagerotate.xml
diff -u phpdoc/en/reference/image/functions/imagerotate.xml:1.4
phpdoc/en/reference/image/functions/imagerotate.xml:1.5
--- phpdoc/en/reference/image/functions/imagerotate.xml:1.4 Mon Apr 12 18:58:32
2004
+++ phpdoc/en/reference/image/functions/imagerotate.xml Mon Oct 4 03:09:47 2004
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<refentry id="function.imagerotate">
<refnamediv>
<refname>imagerotate</refname>
@@ -7,16 +7,48 @@
</refnamediv>
<refsect1>
<title>Description</title>
- <methodsynopsis>
- <type>resource</type><methodname>imagerotate</methodname>
- <methodparam><type>resource</type><parameter>src_im</parameter></methodparam>
- <methodparam><type>float</type><parameter>angle</parameter></methodparam>
- <methodparam><type>int</type><parameter>bgd_color</parameter></methodparam>
- </methodsynopsis>
+ <methodsynopsis>
+ <type>resource</type><methodname>imagerotate</methodname>
+ <methodparam><type>resource</type><parameter>src_im</parameter></methodparam>
+ <methodparam><type>float</type><parameter>angle</parameter></methodparam>
+ <methodparam><type>int</type><parameter>bgd_color</parameter></methodparam>
+ </methodsynopsis>
<para>
Rotates the <parameter>src_im</parameter> image using a given
- <parameter>angle</parameter> in degree. <parameter>bgd_color</parameter>
+ <parameter>angle</parameter> in degrees. <parameter>bgd_color</parameter>
specifies the color of the uncovered zone after the rotation.
+ </para>
+ <para>
+ The center of rotation is the center of the image, and the rotated
+ image is scaled down so that the whole rotated image fits in the
+ destination image - the edges are not clipped.
+ </para>
+ <para>
+ <example>
+ <title>Rotate an image 180 degrees</title>
+ <para>
+ This example rotates an image 180 degrees - upside down.
+ </para>
+ <programlisting role="php">
+<![CDATA[
+// 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);
+]]>
+ </programlisting>
+ </example>
</para>
¬e.bundled.gd;
</refsect1>