<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Creating a parallelogram</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="imagick.shaveimage.html">Imagick::shaveImage</a></div> <div class="next" style="text-align: right; float: right;"><a href="imagick.sigmoidalcontrastimage.html">Imagick::sigmoidalContrastImage</a></div> <div class="up"><a href="class.imagick.html">Imagick</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="imagick.shearimage" class="refentry"> <div class="refnamediv"> <h1 class="refname">Imagick::shearImage</h1> <p class="verinfo">(PECL imagick 2.0.0)</p><p class="refpurpose"><span class="refname">Imagick::shearImage</span> — <span class="dc-title">Creating a parallelogram</span></p> </div> <div class="refsect1 description" id="refsect1-imagick.shearimage-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><strong>Imagick::shearImage</strong></span> ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$background</code></span> , <span class="methodparam"><span class="type">float</span> <code class="parameter">$x_shear</code></span> , <span class="methodparam"><span class="type">float</span> <code class="parameter">$y_shear</code></span> )</div> <p class="para rdfs-comment"> Slides one edge of an image along the X or Y axis, creating a parallelogram. An X direction shear slides an edge along the X axis, while a Y direction shear slides an edge along the Y axis. The amount of the shear is controlled by a shear angle. For X direction shears, x_shear is measured relative to the Y axis, and similarly, for Y direction shears y_shear is measured relative to the X axis. Empty triangles left over from shearing the image are filled with the background color. </p> </div> <div class="refsect1 parameters" id="refsect1-imagick.shearimage-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <code class="parameter">background</code></dt> <dd> <p class="para"> The background color </p> </dd> <dt> <code class="parameter">x_shear</code></dt> <dd> <p class="para"> The number of degrees to shear on the x axis </p> </dd> <dt> <code class="parameter">y_shear</code></dt> <dd> <p class="para"> The number of degrees to shear on the y axis </p> </dd> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-imagick.shearimage-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>TRUE</code></strong> on success. </p> </div> <div class="refsect1 changelog" id="refsect1-imagick.shearimage-changelog"> <h3 class="title">Changelog</h3> <p class="para"> <table class="doctable informaltable"> <thead> <tr> <th>Version</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td>2.1.0</td> <td> Now allows a string representing the color as the first parameter. Previous versions allow only an ImagickPixel object. </td> </tr> </tbody> </table> </p> </div> <div class="refsect1 examples" id="refsect1-imagick.shearimage-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-4028"> <p><strong>Example #1 <span class="function"><strong>Imagick::shearImage()</strong></span></strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">shearImage</span><span style="color: #007700">(</span><span style="color: #0000BB">$imagePath</span><span style="color: #007700">, </span><span style="color: #0000BB">$color</span><span style="color: #007700">, </span><span style="color: #0000BB">$shearX</span><span style="color: #007700">, </span><span style="color: #0000BB">$shearY</span><span style="color: #007700">) {<br /> </span><span style="color: #0000BB">$imagick </span><span style="color: #007700">= new \</span><span style="color: #0000BB">Imagick</span><span style="color: #007700">(</span><span style="color: #0000BB">realpath</span><span style="color: #007700">(</span><span style="color: #0000BB">$imagePath</span><span style="color: #007700">));<br /> </span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-></span><span style="color: #0000BB">shearimage</span><span style="color: #007700">(</span><span style="color: #0000BB">$color</span><span style="color: #007700">, </span><span style="color: #0000BB">$shearX</span><span style="color: #007700">, </span><span style="color: #0000BB">$shearY</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"Content-Type: image/jpg"</span><span style="color: #007700">);<br /> echo </span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-></span><span style="color: #0000BB">getImageBlob</span><span style="color: #007700">();<br />}<br /><br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="imagick.shaveimage.html">Imagick::shaveImage</a></div> <div class="next" style="text-align: right; float: right;"><a href="imagick.sigmoidalcontrastimage.html">Imagick::sigmoidalContrastImage</a></div> <div class="up"><a href="class.imagick.html">Imagick</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>