The ImagickDraw::arc() function is an inbuilt function in Imagick library of PHP which is used to draw an arc.
Syntax:
bool ImagickDraw::arc( $sx, $sy, $ex, $ey, $sd, $ed )
Parameters: This function accepts six parameters as mentioned above and described below:
- $sx: This parameter takes the value of starting x-ordinate.
- $sy: This parameter takes the value of starting y-ordinate.
- $ex:This parameter takes the value of ending x-ordinate.
- $ey: This parameter takes the value of ending y-ordinate.
- $sd: This parameter takes the value of starting angle of rotation in degrees.
- $ed: This parameter takes the value of ending angle of rotation in degrees.
Return Value: This function does not return any value.
Below program illustrates the ImagickDraw::arc() function in PHP:
Program:
<?php
$draw = new ImagickDraw();
$draw ->setStrokeColor( 'Green' );
$draw ->setFillColor( 'Red' );
$draw ->setStrokeWidth(7);
$draw ->arc(120, 30, 250, 180, 50, 190);
$image = new Imagick();
$image ->newImage(300, 300, 'White' );
$image ->setImageFormat( "png" );
$image ->drawImage( $draw );
header( "Content-Type: image/png" );
echo $image ->getImageBlob();
?>
|
Output:

Reference: http://php.net/manual/en/imagickdraw.arc.php
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!