导航首页 » 技术教程 » PHP:imagefill()的用法_GD库图像处理函数
PHP:imagefill()的用法_GD库图像处理函数 155 2023-12-15   

imagefill

(PHP 4, PHP 5)

imagefill — 区域填充

说明

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

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

Example #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);
?>

参见 imagecolorallocate()。


!!!站长长期在线接!!!

网站、小程序:定制开发/二次开发/仿制开发等

各种疑难杂症解决/定制接口/定制采集等

站长微信:lxwl520520

站长QQ:1737366103