PHP 中的 imagefill() 函数
imagefill() 函数用于填充图像。
语法
imagefill(img, x, y, color)
参数
img
使用 imagecreatetruecolor() 创建一张空白图像。x
起始点的 x 坐标y
起始点的 y 坐标color
填充颜色。
返回值
imagefill() 函数在成功时返回 TRUE,在失败时返回 FALSE。
示例
以下是一个示例
<?php
$img = imagecreatetruecolor(400, 400);
$color = imagecolorallocate($img, 190, 255, 120);
imagefill($img, 0, 0, $color);
header('Content-type: image/png');
imagepng($img);
imagedestroy($img);
?>输出
以下为输出

广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程语言
C++
C#
MongoDB
MySQL
Javascript
PHP