PHP | ImagickDraw pathCurveToAbsolute() Function Last Updated : 17 Dec, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The ImagickDraw::pathCurveToAbsolute() function is an inbuilt function in PHP which is used to draw a cubic Bezier curve which is a parametric curve. This function draws a curve from the current point to (x, y) using beginning control point (x1, y1) to ending control point (x2, y2). In the last command, the new current point becomes the final (x, y) coordinate pair used in the polybezier. Syntax: bool ImagickDraw::pathCurveToAbsolute( float $x1, float $y1, float $x2, float $y2, float $x, float $y ) Parameters: This function accepts six parameters as mentioned above and described below: $x1: It specifies the x-coordinate of first control point. $y1: It specifies the y-coordinate of first control point. $x2: It specifies the x-coordinate of second control point. $y2: It specifies the y-coordinate of second control point. $x: It specifies the x-coordinate of curve end. $y: It specifies the y-coordinate of curve end. Return Value: This function returns TRUE on success. Below programs illustrate the ImagickDraw::pathCurveToAbsolute() function in PHP: Program 1: php <?php // Create a new imagick object $imagick = new Imagick(); // Create a image on imagick object $imagick->newImage(800, 250, 'white'); // Create a new ImagickDraw object $draw = new ImagickDraw(); $draw->setFillColor('white'); // Set the stroke color $draw->setStrokeColor('green'); // Set the stroke width $draw->setStrokeWidth(5); // Start a path $draw->pathStart(); $draw->pathCurveToAbsolute(50, 100, 180, 200, 1360, 200); $draw->pathFinish(); // Set the stroke color $draw->setStrokeColor('red'); // Draw curve to absolute (with pathClose()) $draw->pathStart(); $draw->pathCurveToAbsolute(500, 20, 80, 40, 60, 900); $draw->pathClose(); $draw->pathFinish(); // Set the stroke color $draw->setStrokeColor('blue'); // Draw curve to absolute (with pathClose()) $draw->pathStart(); $draw->pathCurveToAbsolute(50, 50, 80, 20, 1360, 200); $draw->pathClose(); $draw->pathFinish(); // Render the draw commands $imagick->drawImage($draw); // Show the output $imagick->setImageFormat('png'); header("Content-Type: image/png"); echo $imagick->getImageBlob(); ?> Output: Program 2: php <?php // Create a new imagick object $imagick = new Imagick(); // Create a image on imagick object $imagick->newImage(800, 250, 'black'); // Create a new ImagickDraw object $draw = new ImagickDraw(); // Set the stroke color $draw->setStrokeColor('white'); // Set the stroke width $draw->setStrokeWidth(5); // Start a path $draw->pathStart(); // Draw curve to absolute $draw->pathCurveToAbsolute(50, 400, 560, 700, 160, 20); $draw->pathCurveToAbsolute(1000, 40, 560, 70, 60, 300); // Close the path $draw->pathFinish(); // Render the draw commands $imagick->drawImage($draw); // Show the output $imagick->setImageFormat('png'); header("Content-Type: image/png"); echo $imagick->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/imagickdraw.pathcurvetoabsolute.php Comment More infoAdvertise with us Next Article PHP | ImagickDraw pathCurveToSmoothAbsolute() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | ImagickDraw pathMoveToAbsolute() Function The ImagickDraw::pathMoveToAbsolute() function is an inbuilt function in PHP which is used to start a new sub-path at the given coordinate using absolute coordinates. The current point then becomes the specified coordinate. This function is used for setting initial coordinates before starting drawin 2 min read PHP | ImagickDraw pathCurveToSmoothAbsolute() Function The ImagickDraw::pathCurveToSmoothAbsolute() function is an inbuilt function in PHP which is used to draw a cubic Bezier curve from the current point to (x, y) using absolute coordinates. Syntax: bool ImagickDraw::pathCurveToSmoothAbsolute ( float $x2, float $y2, float $x, float $y ) Parameters: Thi 2 min read PHP | ImagickDraw pathLineToAbsolute() Function The ImagickDraw::pathLineToAbsolute() function is an inbuilt function in PHP which is used to draw a line path from the current point to the given coordinate using absolute coordinates. The coordinate then becomes the new current point. The initial point can be set using pathMoveToAbsolute() functio 2 min read PHP | ImagickDraw pathCurveToRelative() Function The ImagickDraw::pathCurveToRelative() function is an inbuilt function in PHP which is used to draw a cubic Bezier curve from the current point to (x, y) using (x1, y1) as the control point at the beginning of the curve and (x2, y2) as the control point at the end of the curve using relative coordin 2 min read PHP | ImagickDraw pathCurveToSmoothRelative() Function The ImagickDraw::pathCurveToSmoothRelative() function is an inbuilt function in PHP which is used to draw a cubic Bezier curve from the current point to (x,y) using relative coordinates. Syntax: bool ImagickDraw::pathCurveToSmoothRelative( float $x2, float $y2, float $x, float $y ) Parameters: This 2 min read PHP | ImagickDraw pathCurveToQuadraticBezierAbsolute() Function The ImagickDraw::pathCurveToQuadraticBezierAbsolute() function is an inbuilt function in PHP which is used to draw a quadratic Bezier curve which is nothing but a parametric quadratic curve. Syntax: bool ImagickDraw::pathCurveToQuadraticBezierAbsolute( float $x1, float $y1, float $x, float $y ) Para 2 min read Like