mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-27 06:18:56 +00:00

Well, we're not actually fixing the issue, but rather document the current state. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@340286 c90b9560-bf6c-de11-be94-00142212c4b1
177 lines
4.5 KiB
XML
177 lines
4.5 KiB
XML
<?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>resource</type><methodname>imagerotate</methodname>
|
|
<methodparam><type>resource</type><parameter>image</parameter></methodparam>
|
|
<methodparam><type>float</type><parameter>angle</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>bgd_color</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>ignore_transparent</parameter><initializer>0</initializer></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>bgd_color</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Specifies the color of the uncovered zone after the rotation
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>ignore_transparent</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
If set and non-zero, transparent colors are ignored (otherwise kept).
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Returns an image resource for the rotated image, &return.falseforfailure;.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>5.5.0</entry>
|
|
<entry>
|
|
The <parameter>ignore_transparent</parameter> is now silently ignored.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>5.5.0</entry>
|
|
<entry>
|
|
This function is now affected by the interpolation method set by the
|
|
<function>imagesetinterpolation</function> function.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>5.1.0</entry>
|
|
<entry>
|
|
<parameter>ignore_transparent</parameter> was added.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</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;
|
|
¬e.gd.interpolation;
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>imagesetinterpolation</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</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
|
|
-->
|