(PHP 4, PHP 5)
imagefilledrectangle — Draw a filled rectangle
Creates a rectangle filled with color in the given image starting at point 1 and ending at point 2. 0, 0 is the top left corner of the image.
Ресурс на изображение, върнат от някоя от функциите за създаване на изображения като например imagecreatetruecolor().
x-coordinate for point 1.
y-coordinate for point 1.
x-coordinate for point 2.
y-coordinate for point 2.
The fill color. A color identifier created with imagecolorallocate().
Връща TRUE при успех или FALSE при неуспех.
Example #1 imagefilledrectangle() usage
<?php
// Create a 55x30 image
$im = imagecreatetruecolor(55, 30);
$white = imagecolorallocate($im, 255, 255, 255);
// Draw a white rectangle
imagefilledrectangle($im, 4, 4, 50, 25, $white);
// Save the image
imagepng($im, './imagefilledrectangle.png');
imagedestroy($im);
?>
Примерът по-горе ще изведе нещо подобно на: