imagefilledrectangle

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Draw a filled rectangle
imagefilledrectangle(¬†¬†¬†¬†GdImage $image,¬†¬†¬†¬†int $x1,¬†¬†¬†¬†int $y1,¬†¬†¬†¬†int $x2,¬†¬†¬†¬†int $y2,¬†¬†¬†¬†int $color): bool
        } else {


            
imagefilledrectangle($resource00$width 1$height 1$filling);

        }



        isset(
$tile) ? imagedestroy($tile->getCore()) : null;
        $transparent imagecolorallocatealpha($canvas->getCore(), 255255255127);

        
imagealphablending($canvas->getCore(), false); // do not blend / just overwrite

        
imagefilledrectangle($canvas->getCore(), $dst_x$dst_y$dst_x $src_w 1$dst_y $src_h 1$transparent);




        
imagecopy($canvas->getCore(), $image->getCore(), $dst_x$dst_y$src_x$src_y$src_w$src_h);
        imagealphablending($canvasfalse);

        
$transparent imagecolorallocatealpha($canvas255255255127);

        
imagefilledrectangle($canvas00$width$height$transparent);

        
imagecolortransparent($canvas$transparent);

        
imagealphablending($canvastrue);
    public function applyToImage(Image $image$x 0$y 0)

    {

        
$background = new Color($this->background);

        
imagefilledrectangle($image->getCore(), $this->x1$this->y1$this->x2$this->y2$background->getInt());



        if (
$this->hasBorder()) {

            
$border_color = new Color($this->border_color);