<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.image.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.imagegetclip.php',
    1 => 'imagegetclip',
    2 => 'Get the clipping rectangle',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'GD 和图像处理 函数',
  ),
  'prev' => 
  array (
    0 => 'function.imagegd2.php',
    1 => 'imagegd2',
  ),
  'next' => 
  array (
    0 => 'function.imagegetinterpolation.php',
    1 => 'imagegetinterpolation',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/image/functions/imagegetclip.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imagegetclip" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagegetclip</h1>
  <p class="verinfo">(PHP 7 &gt;= 7.2.0, PHP 8)</p><p class="refpurpose"><span class="refname">imagegetclip</span> &mdash; <span class="dc-title">Get the clipping rectangle</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.imagegetclip-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagegetclip</strong></span>(<span class="methodparam"><span class="type"><a href="class.gdimage.php" class="type GdImage">GdImage</a></span> <code class="parameter">$image</code></span>): <span class="type"><a href="language.types.array.php" class="type array">array</a></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">参数</h3>
  <dl>
   <dt>
<code class="parameter">image</code></dt><dd><p class="para">由图象创建函数(例如<span class="function"><a href="function.imagecreatetruecolor.php" class="function">imagecreatetruecolor()</a></span>)返回的 
<span class="classname"><a href="class.gdimage.php" class="classname">GdImage</a></span> 对象。</p></dd>
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.imagegetclip-returnvalues">
  <h3 class="title">返回值</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 changelog" id="refsect1-function.imagegetclip-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">image</code> 现在需要 <span class="classname"><a href="class.gdimage.php" class="classname">GdImage</a></span> 实例；之前需要有效的 <code class="literal">gd</code> <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>。
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.imagegetclip-examples">
  <h3 class="title">示例</h3>
  <div class="example" id="imagegetclip.example.basic">
   <p><strong>示例 #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">&lt;?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>以上示例会输出：</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Array
(
    [0] =&gt; 10
    [1] =&gt; 10
    [2] =&gt; 89
    [3] =&gt; 89
)</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.imagegetclip-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.imagesetclip.php" class="function" rel="rdfs-seeAlso">imagesetclip()</a> - Set the clipping rectangle</span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>