Syntax:bool ImagickDraw::circle ($ox, $oy, $px, $py)
Parameters:This function takes four parameters as above and described below:
- $ox:this parameter takes the value of the original x- coordinates.
- $oy:this parameter takes the value of the original y-coordinate.
- $px:this parameter takes the value of x -coordinates of the perimeter.
- $py:this parameter takes the value of the y-coordinate of the perimeter.
Returned value: this function does not return any value.The following program illustrates the ImagickDraw::circle()function in PHP:Program: php
// require_once (’ vendor / autoload.php ’);
// Create an ImagickDraw object
$draw
=
new
ImagickDraw();
// Create an ImagickPixel
$strokeColor
=
new
ImagickPixel (
’Red’
);
$fillColor
=
new
ImagickPixel (
’Green’
);
// Set the color, opacity of the image
$draw
-> setStrokeOpacity (1);
$draw
-> setStrokeColor (
’Red’
);
$draw
-> setFillColor (
’Green’
);
// Set the width and height of the image
$draw
-> setStrokeWidth (7);
$draw
-> setFontSize (72);
// Function for drawing a circle
$draw
-> circle (250, 250, 100, 150);
$imagick
=
new
Imagick();
$imagick
-> newImage (500, 500,
’White’
);
$imagick
-> setImageFormat (
"png"
);
$imagick
-> drawImage (
$draw
);
// Display the output image
header (
"Content-Type: image / png"
);
echo
$imagick
-> getImageBlob();
?>
Output: Link: http://php.net/manual/en/imagickdraw.circle.php
PHP ImagickDraw () circle function circle: Questions
PHP ImagickDraw () circle function PHP: Questions