php-doc-en/reference/image/functions/imagefilltoborder.xml
Christoph Michael Becker 1faec0faeb DRY
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@344594 c90b9560-bf6c-de11-be94-00142212c4b1
2018-03-31 11:57:01 +00:00

132 lines
3.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.imagefilltoborder" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>imagefilltoborder</refname>
<refpurpose>Flood fill to specific color</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>imagefilltoborder</methodname>
<methodparam><type>resource</type><parameter>image</parameter></methodparam>
<methodparam><type>int</type><parameter>x</parameter></methodparam>
<methodparam><type>int</type><parameter>y</parameter></methodparam>
<methodparam><type>int</type><parameter>border</parameter></methodparam>
<methodparam><type>int</type><parameter>color</parameter></methodparam>
</methodsynopsis>
<para>
<function>imagefilltoborder</function> performs a flood fill
whose border color is defined by <parameter>border</parameter>.
The starting point for the fill is <parameter>x</parameter>,
<parameter>y</parameter> (top left is 0, 0) and the region is
filled with color <parameter>color</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&gd.image.description;
<varlistentry>
<term><parameter>x</parameter></term>
<listitem>
<para>
x-coordinate of start.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>y</parameter></term>
<listitem>
<para>
y-coordinate of start.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>border</parameter></term>
<listitem>
<para>
The border color. &gd.identifier.color;
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>color</parameter></term>
<listitem>
<para>
The fill color. &gd.identifier.color;
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Filling an ellipse with a color</title>
<programlisting role="php">
<![CDATA[
<?php
// Create the image handle, set the background to white
$im = imagecreatetruecolor(100, 100);
imagefilledrectangle($im, 0, 0, 100, 100, imagecolorallocate($im, 255, 255, 255));
// Draw an ellipse to fill with a black border
imageellipse($im, 50, 50, 50, 50, imagecolorallocate($im, 0, 0, 0));
// Set the border and fill colors
$border = imagecolorallocate($im, 0, 0, 0);
$fill = imagecolorallocate($im, 255, 0, 0);
// Fill the selection
imagefilltoborder($im, 50, 50, $border, $fill);
// Output and free memory
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
]]>
</programlisting>
&example.outputs.similar;
<mediaobject>
<alt>Output of example : Filling an ellipse with a color</alt>
<imageobject>
<imagedata fileref="en/reference/image/figures/imagefilltoborder.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
-->