(No version information available, might only be in Git)
Imagick::floodFillPaintImage — Changes the color value of any pixel that matches target
$fill
, float $fuzz
, mixed $target
, int $x
, int $y
, bool $invert
[, int $channel = Imagick::CHANNEL_DEFAULT
] )Changes the color value of any pixel that matches target and is an immediate neighbor. This method is a replacement for deprecated Imagick::paintFloodFillImage(). 이 메쏘드는 Imagick을 ImageMagick 6.3.8 이상으로 컴파일 했을 때만 사용할 수 있습니다.
fillImagickPixel object or a string containing the fill color
fuzzfuzz 양. 예를 들면, fuzz를 10으로 설정했을 때 붉은색의 농도를 100과 102로 설정한 것은 같은 색으로 취급합니다.
targetImagickPixel object or a string containing the target color to paint
xX start position of the floodfill
yY start position of the floodfill
invert
If TRUE paints any pixel that does not match the target color.
channel
채널 모드에 유효한 채널 상수를 제공합니다.
둘 이상의 채널을 적용하려면, 비트 연산자를 이용해서 채널 상수를 조합하십시오.
기본값은
Imagick::CHANNEL_DEFAULT. 채널 상수 목록을 참고하십시오.
성공시에 TRUE를 반환합니다.
Example #1 Imagick::floodfillPaintImage() example
<?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");
?>
위 예제의 출력 예시: