(PHP 4, PHP 5, PHP 7, PHP 8)
imagefill — 區(qū)域填充
$image
,$x
,$y
,$color
imagefill() 在 image
圖像的坐標 x
,y
(圖像左上角為
0, 0)處用 color
顏色執(zhí)行區(qū)域填充(即與 x, y 點顏色相同且相鄰的點都會被填充)。
示例 #1 imagefill() 例子
<?php
$im = imagecreatetruecolor(100, 100);
// 將背景設為紅色
$red = imagecolorallocate($im, 255, 0, 0);
imagefill($im, 0, 0, $red);
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>