imagefill

(PHP 4, PHP 5, PHP 7, PHP 8)

imagefill區(qū)域填充

說明

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

imagefill()image 圖像的坐標(biāo) x,y(圖像左上角為 0, 0)處用 color 顏色執(zhí)行區(qū)域填充(即與 x, y 點(diǎn)顏色相同且相鄰的點(diǎn)都會被填充)。

示例 #1 imagefill() 例子

<?php

$im 
imagecreatetruecolor(100100);

// 將背景設(shè)為紅色
$red imagecolorallocate($im25500);
imagefill($im00$red);

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

參見 imagecolorallocate()。