From 11be0104641379512d200b80d14851d5c9fb9fa2 Mon Sep 17 00:00:00 2001 From: Mikko Koppanen Date: Sat, 3 Oct 2009 12:32:14 +0000 Subject: [PATCH] Added floodfillpaint example and images generated git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@289126 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../figures/floodfillpaint_intermediate.png | Bin 0 -> 497 bytes .../imagick/figures/floodfillpaint_result.png | Bin 0 -> 521 bytes .../imagick/imagick/floodfillpaintimage.xml | 59 +++++++++++++++++- 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 reference/imagick/figures/floodfillpaint_intermediate.png create mode 100644 reference/imagick/figures/floodfillpaint_result.png diff --git a/reference/imagick/figures/floodfillpaint_intermediate.png b/reference/imagick/figures/floodfillpaint_intermediate.png new file mode 100644 index 0000000000000000000000000000000000000000..2e9cb81cd6db6b5b375fecb0bb27a414b055bb88 GIT binary patch literal 497 zcmeAS@N?(olHy`uVBq!ia0vp^DL_0;fC)%`_eui^a29w(76WMyFm^kcZO6dCxY*Oh zF{I+w+bah-4;TnAA1v1Lf9@w7$&$yRLbUiP~0bL0-pZEJVAz+$rgoI~eJ(KG7(8A5T-G@yGywo(pNDP$ literal 0 HcmV?d00001 diff --git a/reference/imagick/figures/floodfillpaint_result.png b/reference/imagick/figures/floodfillpaint_result.png new file mode 100644 index 0000000000000000000000000000000000000000..1962c91e8e28ba8118e739c4fd9243dc9b0d3657 GIT binary patch literal 521 zcmeAS@N?(olHy`uVBq!ia0vp^DL_0;fDK4iXnbS^Qfx`y?k@kqfHUIz9iRwjfk$L9 zkoEv$x0Bg+3=E7bJzX3_DsH{Kx{>#=0|T?6<%tLP{unznWWQ~i<8apT`nKHXJU>2H zRx#|E>7c;D(nNpaQ2Fln%iRw|R|;@2H7X1Uaedp|;&YdsAN1OAurxXd3zopr0Q2c~X8-^I literal 0 HcmV?d00001 diff --git a/reference/imagick/imagick/floodfillpaintimage.xml b/reference/imagick/imagick/floodfillpaintimage.xml index 6b61b634af..dbeff2a443 100644 --- a/reference/imagick/imagick/floodfillpaintimage.xml +++ b/reference/imagick/imagick/floodfillpaintimage.xml @@ -12,7 +12,7 @@ boolImagick::floodFillPaintImage mixedfill floatfuzz - mixedbordercolor + mixedtarget intx inty boolinvert @@ -48,10 +48,10 @@ - bordercolor + target - 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 @@ -98,6 +98,59 @@ + + &reftitle.examples; + + + <methodname>Imagick::floodfillPaintImage</methodname> example + +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"); +?> +]]> + + &example.outputs.similar; + + + + + + + + + + + +