Forum und email

imagefill

(PHP 4, PHP 5)

imagefill — Flood fill

설명

bool imagefill ( resource $image , int $x , int $y , int $color )

Performs a flood fill starting at the given coordinate (top left is 0, 0) with the given color in the image .

매개변수

font

내장 글꼴 1, 2, 3, 4, 5(큰 숫자가 큰 글꼴)나 imageloadfont()로 등록한 글꼴 식별자를 사용할 수 있습니다.

x

x-coordinate of start point

y

y-coordinate of start point

color

The fill color. A color identifier created with imagecolorallocate()

반환값

성공할 경우 TRUE를, 실패할 경우 FALSE를 반환합니다.

예제

Example#1 imagefill() example

<?php

$im 
imagecreatetruecolor(100100);

// sets background to red
$red imagecolorallocate($im25500);
imagefill($im00$red);

header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>

위 예제의 출력 예: