php-doc-en/reference/image/functions/imageflip.xml
Máté Kocsis 593ea510e8
Generate ext/gd methodsynopses based on stubs
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-623.
2021-05-24 13:14:32 +02:00

192 lines
4.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<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>GdImage</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="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
&gd.changelog.image-param;
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Flips an image vertically</title>
<para>
This example uses the <constant>IMG_FLIP_VERTICAL</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 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.png"/>
</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/imagefliphorizontal.png"/>
</imageobject>
</mediaobject>
</example>
</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
-->