首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

imagefill

(PHP 4, PHP 5, PHP 7)

imagefill - 倾倒填充

描述倾倒

代码语言:javascript
复制
bool imagefill ( resource $image , int $x , int $y , int $color )

进行倾倒填充开始在给定的坐标(左上为0,0)与给定colorimage

参数

代码语言:txt
复制
`image`   

一个图像资源,由图像创建函数之一返回,如imagecreatetruecolor()。

x

起点的x坐标。

y

起点的y坐标。

color

填充颜​​色。使用imagecolorallocate()创建的颜色标识符。

返回值

返回TRUE成功或失败时返回FALSE

例子

Example #1 imagefill() example

代码语言:javascript
复制
<?php

$im = imagecreatetruecolor(100, 100);

// sets background to red
$red = imagecolorallocate($im, 255, 0, 0);
imagefill($im, 0, 0, $red);

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

上面的例子会输出类似于:

← imageellipse

imagefilledarc →

扫码关注腾讯云开发者

领取腾讯云代金券