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