哈希空间 Ctrl + F 进行搜索
首页 php手册中文版 CSS中文手册 哈希文档 Markdown在线工具

imagefill

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

imagefill区域填充

说明

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

imagefill()image 图像的坐标 xy(图像左上角为 0, 0)处用 color 颜色执行区域填充(即与 x, y 点颜色相同且相邻的点都会被填充)。

示例 #1 imagefill() 例子

<?php

$im 
imagecreatetruecolor(100100);

// 将背景设为红色
$red imagecolorallocate($im25500);
imagefill($im00$red);

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

参见 imagecolorallocate()

打开 哈希空间 微信小程序中查看更佳