ImagickDraw::rectangle


wizard apg

DRAWS a rectangle.



<?php

bool 
public ImagickDraw::rectangle(
                                             
float $x1,
                                             
float $y1,
                                             
float $x2,
                                             
float $y2
                                                         
);

?>

$x1


The X coordinate of the top left corner.



$y1


The Y coordinate of the top left corner.



$x2


The X coordinate of the bottom right corner.



$y2


The Y coordinate of the bottom right corner.





This function returns a TRUE on success.



  1 EXERCISE   

<?php

// 'color-name', '#XXYYZZ', rgb(X,Y,Z), rbga(X%,Y%,Z%,A), cmyck(X,Y,Z,K)

$stroke_color = '#000000';
$fill_color = 'red';
$stroke_width = 200.0;

$x1 = $y1 = 100;

$x2 = $y2 = 200;


$draw = new ImagickDraw();

$draw->setStrokeWidth($stroke_width);
$draw->setStrokeColor($stroke_color);
$draw->setFillColor($fill_color);

// ...

$draw->rectangle($x1, $y1, $x2, $y2);

// ...

// continues on the next page...

?>