imagefilledrectangle

Draw a filled rectangle

&reftitle.description; `bool` `imagefilledrectangle` `GdImage` `image` `int` `x1` `int` `y1` `int` `x2` `int` `y2` `int` `color`

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.

&reftitle.parameters;

&gd.image.description;

`x1`

- x-coordinate for point 1.

`y1`

- y-coordinate for point 1.

`x2`

- x-coordinate for point 2.

`y2`

- y-coordinate for point 2.

`color`

- The fill color. &gd.identifier.color;

&reftitle.returnvalues;

&return.success;

&reftitle.changelog;

&Version; | &Description;
&gd.changelog.image-param;

&reftitle.examples;

### `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);
    ?>

&example.outputs.similar; Output of example : imagefilledrectangle()