<!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>Get the clipping rectangle</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.imagegd.html">imagegd</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.imagegif.html">imagegif</a></div> <div class="up"><a href="ref.image.html">GD and Image Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.imagegetclip" class="refentry"> <div class="refnamediv"> <h1 class="refname">imagegetclip</h1> <p class="verinfo">(PHP 7 >= 7.2.0)</p><p class="refpurpose"><span class="refname">imagegetclip</span> — <span class="dc-title">Get the clipping rectangle</span></p> </div> <div class="refsect1 description" id="refsect1-function.imagegetclip-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">array</span> <span class="methodname"><strong>imagegetclip</strong></span> ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$im</code></span> )</div> <p class="para rdfs-comment"> <span class="function"><strong>imagegetclip()</strong></span> retrieves the current clipping rectangle, i.e. the area beyond which no pixels will be drawn. </p> </div> <div class="refsect1 parameters" id="refsect1-function.imagegetclip-parameters"> <h3 class="title">Parameters</h3> <dl> <dt> <code class="parameter"> image</code></dt> <dd> <p class="para">An image resource, returned by one of the image creation functions, such as <span class="function"><a href="function.imagecreatetruecolor.html" class="function">imagecreatetruecolor()</a></span>.</p></dd> </dl> </div> <div class="refsect1 returnvalues" id="refsect1-function.imagegetclip-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> The function returns an indexed array with the coordinates of the clipping rectangle which has the following entries: <ul class="itemizedlist"> <li class="listitem"> <span class="simpara">x-coordinate of the upper left corner</span> </li> <li class="listitem"> <span class="simpara">y-coordinate of the upper left corner</span> </li> <li class="listitem"> <span class="simpara">x-coordinate of the lower right corner</span> </li> <li class="listitem"> <span class="simpara">y-coordinate of the lower right corner</span> </li> </ul> </p> </div> <div class="refsect1 examples" id="refsect1-function.imagegetclip-examples"> <h3 class="title">Examples</h3> <div class="example" id="example-3815"> <p><strong>Example #1 <span class="function"><strong>imagegetclip()</strong></span> example</strong></p> <div class="example-contents"><p> Setting and retrieving the clipping rectangle. </p></div> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />$im </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecreate</span><span style="color: #007700">(</span><span style="color: #0000BB">100</span><span style="color: #007700">, </span><span style="color: #0000BB">100</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagesetclip</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">10</span><span style="color: #007700">,</span><span style="color: #0000BB">10</span><span style="color: #007700">, </span><span style="color: #0000BB">89</span><span style="color: #007700">,</span><span style="color: #0000BB">89</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">imagegetclip</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">));</span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> Array ( [0] => 10 [1] => 10 [2] => 89 [3] => 89 ) </pre></div> </div> </div> </div> <div class="refsect1 seealso" id="refsect1-function.imagegetclip-seealso"> <h3 class="title">See Also</h3> <ul class="simplelist"> <li class="member"><span class="function"><a href="function.imagesetclip.html" class="function" rel="rdfs-seeAlso">imagesetclip()</a> - Set the clipping rectangle</span></li> </ul> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.imagegd.html">imagegd</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.imagegif.html">imagegif</a></div> <div class="up"><a href="ref.image.html">GD and Image Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>