The ImagickDraw::skewY() function is an inbuilt function in PHP which is used to skews the current coordinate system in the vertical direction.
Syntax:
bool ImagickDraw::skewY( $degrees )
Parameters: This function accepts a single parameter $degrees which is used to hold the degrees to skew.
Return Value: This function does not return return any value.
Below programs illustrate the ImagickDraw::skewY() function in PHP:
Program 1:
<?php // require_once('path/vendor/autoload.php'); // Create an ImagickDraw object. $draw = new ImagickDraw(); // Set the image filled color $draw->setFillColor('blue'); $points = [['x' => 40 * 5, 'y' => 10 * 5], ['x' => 70 * 5, 'y' => 50 * 5], ['x' => 60 * 5, 'y' => 15 * 5], ]; // Draw the polygon $draw->polygon($points); // Set the image filled color $draw->setFillColor('red'); $draw->skewY(-60); $points = [['x' => 40 * 5, 'y' => 10 * 5], ['x' => 70 * 5, 'y' => 50 * 5], ['x' => 60 * 5, 'y' => 15 * 5], ]; // Draw the polygon $draw->polygon($points); // Set the image filled color $draw->setFillColor('green'); $draw->skewY(30); $points = [['x' => 40 * 5, 'y' => 10 * 5], ['x' => 70 * 5, 'y' => 50 * 5], ['x' => 60 * 5, 'y' => 15 * 5], ]; // Draw the polygon $draw->polygon($points); // Create new Imagick object $image = new Imagick(); // Set the image dimensions $image->newImage(500, 500, 'white'); // Set the image format $image->setImageFormat("png"); // Draw the image $image->drawImage($draw); header("Content-Type: image/png"); // Display the image echo $image->getImageBlob(); ?> |
Output:

Program 2:
<?php // require_once('path/vendor/autoload.php'); // Create an ImagickDraw object $draw = new ImagickDraw(); // Set the stroke color $draw->setStrokeColor('black'); // Set the image filled color $draw->setFillColor('red'); // Draw the circle $draw->circle(250, 250, 100, 150); // Set the image filled color $draw->setFillColor('green'); $draw->skewY(-30); // Draw the circle $draw->circle(250, 250, 100, 150); // Set the image filled color $draw->setFillColor('yellow'); $draw->skewY(-60); // Draw the circle $draw->circle(250, 250, 100, 150); // Create new Imagick object $image = new Imagick(); // Set the image dimensions $image->newImage(700, 700, 'white'); // Set the image format $image->setImageFormat("png"); // Draw the image $image->drawImage($draw); header("Content-Type: image/png"); // Display the image echo $image->getImageBlob(); ?> |
Output:

Reference: http://php.net/manual/en/imagickdraw.skewy.php
Recommended Posts:
- CSS | skewY() Function
- Fabric.js | Circle skewY Property
- Fabric.js | Rect skewY Property
- Fabric.js | Triangle skewY Property
- Fabric.js | Ellipse skewY Property
- Fabric.js Polyline skewY Property
- PHP | ImagickDraw getTextAlignment() Function
- PHP | ImagickDraw scale() Function
- PHP | ImagickDraw polygon() Function
- PHP | ImagickDraw roundRectangle() Function
- PHP | ImagickDraw arc() Function
- PHP | ImagickDraw circle() Function
- PHP | ImagickDraw bezier() Function
- PHP | ImagickDraw rectangle() Function
- PHP | ImagickDraw line() Function
- PHP | ImagickDraw point() Function
- PHP | ImagickDraw skewX() Function
- PHP | ImagickDraw setStrokeWidth() Function
- PHP | ImagickDraw translate() Function
- PHP | ImagickDraw setStrokeOpacity() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


