php-doc-en/reference/imagick/imagick/floodfillpaintimage.xml
2012-01-12 05:08:38 +00:00

176 lines
4.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="imagick.floodfillpaintimage">
<refnamediv>
<refname>Imagick::floodFillPaintImage</refname>
<refpurpose>Changes the color value of any pixel that matches target</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>Imagick::floodFillPaintImage</methodname>
<methodparam><type>mixed</type><parameter>fill</parameter></methodparam>
<methodparam><type>float</type><parameter>fuzz</parameter></methodparam>
<methodparam><type>mixed</type><parameter>target</parameter></methodparam>
<methodparam><type>int</type><parameter>x</parameter></methodparam>
<methodparam><type>int</type><parameter>y</parameter></methodparam>
<methodparam><type>bool</type><parameter>invert</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>channel</parameter><initializer>Imagick::CHANNEL_DEFAULT</initializer></methodparam>
</methodsynopsis>
<para>
Changes the color value of any pixel that matches target and is an
immediate neighbor. This method is a replacement for deprecated
<function>Imagick::paintFloodFillImage</function>.
&imagick.method.available.0x638;
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>fill</parameter></term>
<listitem>
<para>
ImagickPixel object or a string containing the fill color
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>fuzz</parameter></term>
<listitem>
<para>
&imagick.parameter.fuzz;
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>target</parameter></term>
<listitem>
<para>
ImagickPixel object or a string containing the target color to paint
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>x</parameter></term>
<listitem>
<para>
X start position of the floodfill
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>y</parameter></term>
<listitem>
<para>
Y start position of the floodfill
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>invert</parameter></term>
<listitem>
<para>
If &true; paints any pixel that does not match the target color.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>channel</parameter></term>
<listitem>
<para>
&imagick.parameter.channel;
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&imagick.return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><methodname>Imagick::floodfillPaintImage</methodname> example</title>
<programlisting role="php">
<![CDATA[
<?php
/* Create new imagick object */
$im = new Imagick();
/* create red, green and blue images */
$im->newImage(100, 50, "red");
$im->newImage(100, 50, "green");
$im->newImage(100, 50, "blue");
/* Append the images into one */
$im->resetIterator();
$combined = $im->appendImages(true);
/* Save the intermediate image for comparison */
$combined->writeImage("floodfillpaint_intermediate.png");
/* The target pixel to paint */
$x = 1;
$y = 1;
/* Get the color we are painting */
$target = $combined->getImagePixelColor($x, $y);
/* Paints pixel in position 1,1 black and all neighboring
pixels that match the target color */
$combined->floodfillPaintImage("black", 1, $target, $x, $y, false);
/* Save the result */
$combined->writeImage("floodfillpaint_result.png");
?>
]]>
</programlisting>
&example.outputs.similar;
<mediaobject>
<alt>Output of example : Imagick::floodfillPaintImage()</alt>
<imageobject>
<imagedata fileref="en/reference/imagick/figures/floodfillpaint_intermediate.png"/>
</imageobject>
<imageobject>
<imagedata fileref="en/reference/imagick/figures/floodfillpaint_result.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
-->