ฟังก์ชัน imagefill() ใช้สำหรับเติมรูปภาพ
ไวยากรณ์
imagefill(img, x, y, color)
พารามิเตอร์
-
img
สร้างภาพเปล่าด้วย imagecreatetruecolor() -
x
พิกัด x ของจุดเริ่มต้น -
ย
พิกัด y ของจุดเริ่มต้น -
สี
สีเติม
คืนสินค้า
ฟังก์ชัน 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);
?> ผลลัพธ์
ต่อไปนี้เป็นผลลัพธ์:
