![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
imagefill() function in PHP
The imagefill() function is used to fill the image.
Syntax
imagefill(img, x, y, color)
Parameters
img
Create a blank image with imagecreatetruecolor().x
x-coordinate of start pointy
y-coordinate of start pointcolor
The fill color.
Return
The imagefill() function returns TRUE on success or FALSE on failure.
Example
The following is an example:
<?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); ?>
Output
The following is the output:
Advertisements