imagerectangle


]Podporované v PHP 4, PHP 5 

PHP -> Funkcie -> Grafické funkcie PHP - > imagerectangle

Syntax

bool imagerectangle ( resource $image , int $x1 , int $y1 , int $x2 , int $y2 , int $color )

Popis

Príkaz jazyka PHP
imagerectangle() creates a rectangle starting at the specified coordinates.

Parameters



Return Values

Returns TRUE on success or FALSE on failure.

Príklad

<?php
// Create a 200 x 200 image
$canvas = imagecreatetruecolor(200, 200);

// Allocate colors
$pink = imagecolorallocate($canvas, 255, 105, 180);
$white = imagecolorallocate($canvas, 255, 255, 255);
$green = imagecolorallocate($canvas, 132, 135, 28);

// Draw three rectangles each with its own color
imagerectangle($canvas, 50, 50, 150, 150, $pink);
imagerectangle($canvas, 45, 60, 120, 100, $white);
imagerectangle($canvas, 100, 120, 75, 160, $green);

// Output and free from memory
header('Content-Type: image/jpeg');

imagejpeg($canvas);
imagedestroy($canvas);
?>


]