Documented imageflip(), available as of PHP 5.5.0 using LibGD

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@329873 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Kalle Sommer Nielsen 2013-03-22 16:08:07 +00:00
parent d08076c1f0
commit f50b25ab8b
5 changed files with 219 additions and 0 deletions

View file

@ -789,6 +789,43 @@
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.img-flip-vertical">
<term>
<constant>IMG_FLIP_VERTICAL</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
Used together with <function>imageflip</function>, available as of PHP 5.5.0.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.img-flip-horizontal">
<term>
<constant>IMG_FLIP_HORIZONTAL</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
Used together with <function>imageflip</function>, available as of PHP 5.5.0.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.img-flip-both">
<term>
<constant>IMG_FLIP_BOTH</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
Used together with <function>imageflip</function>, available as of PHP 5.5.0.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</appendix>
<!-- Keep this comment at the end of the file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -0,0 +1,179 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $ -->
<refentry xml:id="function.imageflip" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>imageflip</refname>
<refpurpose>Flips an image using a given mode</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>imageflip</methodname>
<methodparam><type>resource</type><parameter>image</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
Flips the <parameter>image</parameter> image using the given
<parameter>mode</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&gd.image.description;
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
Flip mode, this can be one of the <constant>IMG_FLIP_*</constant> constants:
</para>
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>Constant</entry>
<entry>Meaning</entry>
</row>
</thead>
<tbody>
<row>
<entry><constant>IMG_FLIP_HORIZONTAL</constant></entry>
<entry>
Flips the image horizontally.
</entry>
</row>
<row>
<entry><constant>IMG_FLIP_VERTICAL</constant></entry>
<entry>
Flips the image vertically.
</entry>
</row>
<row>
<entry><constant>IMG_FLIP_BOTH</constant></entry>
<entry>
Flips the image both horizontally and vertically.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Flips an image vertically</title>
<para>
This example uses the <constant>IMG_FLIP_VERTICAL</constant>.
</para>
<programlisting role="php">
<![CDATA[
<?php
// File
$filename = 'phplogo.png';
// Content type
header('Content-type: image/png');
// Load
$im = imagecreatefrompng($filename);
// Flip it vertically
imageflip($im, IMG_FLIP_VERTICAL);
// Output
imagejpeg($im);
imagedestroy($im);
?>
]]>
</programlisting>
&example.outputs.similar;
<mediaobject>
<alt>Output of example: Vertically flipped image</alt>
<imageobject>
<imagedata fileref="en/reference/image/figures/imageflipvertical.jpg"/>
</imageobject>
</mediaobject>
</example>
</para>
<para>
<example>
<title>Flips the image horizontally</title>
<para>
This example uses the <constant>IMG_FLIP_HORIZONTAL</constant> constant.
</para>
<programlisting role="php">
<![CDATA[
<?php
// File
$filename = 'phplogo.png';
// Content type
header('Content-type: image/png');
// Load
$im = imagecreatefrompng($filename);
// Flip it horizontally
imageflip($im, IMG_FLIP_HORIZONTAL);
// Output
imagejpeg($im);
imagedestroy($im);
?>
]]>
</programlisting>
&example.outputs.similar;
<mediaobject>
<alt>Output of example: Horizontally flipped image</alt>
<imageobject>
<imagedata fileref="en/reference/image/figures/imagefliphorizonal.jpg"/>
</imageobject>
</mediaobject>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&note.bundled.gd;
</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
-->

View file

@ -49,6 +49,8 @@
<function name='imagecreatefromxbm' from='PHP 4 &gt;= 4.0.1, PHP 5'/>
<function name='imagecreatefromxpm' from='PHP 4 &gt;= 4.0.1, PHP 5'/>
<function name='imagecreatetruecolor' from='PHP 4 &gt;= 4.0.6, PHP 5'/>
<function name='imagecrop' from='PHP &gt;= 5.5.0'/>
<function name='imagecropauto' from='PHP &gt;= 5.5.0'/>
<function name='imagedashedline' from='PHP 4, PHP 5'/>
<function name='imagedestroy' from='PHP 4, PHP 5'/>
<function name='imageellipse' from='PHP 4 &gt;= 4.0.6, PHP 5'/>
@ -59,6 +61,7 @@
<function name='imagefilledrectangle' from='PHP 4, PHP 5'/>
<function name='imagefilltoborder' from='PHP 4, PHP 5'/>
<function name='imagefilter' from='PHP 5'/>
<function name='imageflip' from='PHP &gt;= 5.5.0'/>
<function name='imagefontheight' from='PHP 4, PHP 5'/>
<function name='imagefontwidth' from='PHP 4, PHP 5'/>
<function name='imageftbbox' from='PHP 4 &gt;= 4.0.7, PHP 5'/>