PHP | imagefilledarc() Function Last Updated : 23 Aug, 2019 Comments Improve Suggest changes Like Article Like Report The imagefilledarc() function is an inbuilt function in PHP which is used to draws a partial arc centered at the specified coordinate in the given image. This function return True on success or False on failure Syntax: bool imagefilledarc ( $image, $cx, $cy, $width, $height, $start, $end, $color, $style ) Parameters: This function accepts nine parameters as mentioned above and described below: $image: It is returned by one of the image creation functions, such as imagecreatetruecolor(). It is used to create size of image.. $cx: This parameter is used to set the x-coordinate of the center. $cy: This parameter is used to set the y-coordinate of the center. $width: This parameter is used to set the arc width. $height: This parameter is used to set the arc height. $start: The arc start angle, in degrees. $end: The arc end angle, in degrees. 0° is located at the three-o'clock position, and the arc is drawn clockwise. $color: A color identifier created with imagecolorallocate(). $style: Suggest how to fill the image and its values can be any one among the value listed below. IMG_ARC_PIE IMG_ARC_CHORD IMG_ARC_NOFILL IMG_ARC_EDGED Return Values: This function returns True on success or False on failure. Below programs illustrate the imagefilledarc() function in PHP: Program 1: php <?php define("WIDTH", 300); define("HEIGHT", 300); // Create image. $img = imagecreate(WIDTH, HEIGHT); // Allocate colors. $bg = $white = imagecolorallocate($img, 0xFF, 0xFF, 0xFF); $green = imagecolorallocate($img, 0, 255, 0); // make pie arc. $center_x = (int)WIDTH/2; $center_y = (int)HEIGHT/2; imagerectangle($img, 0, 0, WIDTH-1, HEIGHT-1, $green); imagefilledarc($img, $center_x, $center_y, WIDTH/2, HEIGHT/2, 0, 220, $green, IMG_ARC_PIE); // Flush image. header("Content-Type: image/png"); imagepng($img); ?> Output: Program 2: php <?php // Create image $image = imagecreatetruecolor(100, 100); // Allocate some colors $red = imagecolorallocate($image, 0xFF, 0x00, 0x00); $darkred = imagecolorallocate($image, 0x90, 0x00, 0x00); // Make the 3D effect for ($i = 60; $i > 50; $i--) { imagefilledarc($image, 50, $i, 100, 50, 75, 360, $darkred, IMG_ARC_PIE); } imagefilledarc($image, 50, 50, 100, 50, 75, 360, $red, IMG_ARC_PIE); // flush image header('Content-type: image/png'); imagepng($image); imagedestroy($image); ?> Output: Reference: http://php.net/manual/en/function.imagefilledarc.php Comment More infoAdvertise with us Next Article PHP | imagefilledarc() Function V Vishal_Khoda Follow Improve Article Tags : Misc Web Technologies PHP Image-Processing PHP-function +1 More Practice Tags : Misc Similar Reads PHP | imagefill() Function The imagefill() function is an inbuilt function in PHP which is used to fill the image with the given color. This function performs a flood fill starting at the given coordinate (top left is 0, 0) with the given color in the image. Syntax: bool imagefill( $image, $x, $y, $color ) Parameters:This fun 2 min read PHP | imagearc() Function The imagearc() function is an inbuilt function in PHP which is used to create an arc of a circle centered at the given coordinates. This function returns true on success or false on failure. Syntax: bool imagearc( $image, $cx, $cy, $width, $height, $start, $end, $color ) Parameters: This function ac 3 min read PHP | imagefilledrectangle() Function The imagefilledrectangle() function is an inbuilt function in PHP which is used to create a filled rectangle. This function creates a rectangle filled with a given color in the image. The top left corner of the image is (0, 0). Syntax: bool imagefilledrectangle( $image, $x1, $y1, $x2, $y2, $color ) 2 min read PHP | imagefilltoborder() Function The imagefilltoborder() function is an inbuilt function in PHP which is used to performs a flood fill with a specific color and add a border with a border color. Syntax: bool imagefilltoborder( resource $image, int $x, int $y, int $border, int $color ) Parameters: This function accept five parameter 2 min read PHP | imagefilledpolygon() Function The imagefilledpolygon() function is an inbuilt function in PHP which is used to draw a filled polygon. This function Returns TRUE on success and returns FALSE otherwise. Syntax:Â bool imagefilledpolygon( $image, $points, $num_points, $color ) Parameters: This function accepts four parameters as men 2 min read PHP | imageaffine() Function The imageaffine() function is an inbuilt function in PHP which is used to get an image containing the affine transformed src image using an optional clipping area. Affine is a geometric transformation operation involving MATRICES. Syntax: resource imageaffine( resource $image, array $affine, array $ 2 min read PHP | imagesettile() Function The imagesettile() function is an inbuilt function in PHP which is used to set the tile image for filling the area. Syntax: bool imagesettile( $image, $tile ) Parameters: This function accepts two parameters as mentioned above and described below: $image: It is returned by one of the image creation 2 min read PHP | imagegif() Function The imagegif() function is an inbuilt function in PHP which is used to create the GIF image file from the given image. If the image has been made transparent with imagecolortransparent() function, then GIF89a image format will generate otherwise GIF87a image format will generate. Syntax: bool imageg 2 min read PHP | imagecreate() Function The imagecreate() function is an inbuilt function in PHP which is used to create a new image. This function returns the blank image of given size. In general imagecreatetruecolor() function is used instead of imagecreate() function because imagecreatetruecolor() function creates high quality images. 2 min read PHP | imagecrop() Function The imagecrop() function is an inbuilt function in PHP which is used to crop an image to the given rectangle. This function crops an image to the given rectangular area and returns the resulting image. The given image is not modified. Syntax: resource imagecrop ( $image, $rect ) Parameters: This fun 1 min read Like