Added floodfillpaint example and images generated

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@289126 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Mikko Koppanen 2009-10-03 12:32:14 +00:00
parent 78a694350e
commit 11be010464
3 changed files with 56 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

View file

@ -12,7 +12,7 @@
<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>bordercolor</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>
@ -48,10 +48,10 @@
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>bordercolor</parameter></term>
<term><parameter>target</parameter></term>
<listitem>
<para>
ImagickPixel object or a string containing the border color. This is the target color to paint.
ImagickPixel object or a string containing the target color to paint
</para>
</listitem>
</varlistentry>
@ -98,6 +98,59 @@
</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>
<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