<?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.imagedestroy.php',
    1 => 'imagedestroy',
    2 => '销毁图像',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'GD 和图像处理 函数',
  ),
  'prev' => 
  array (
    0 => 'function.imagedashedline.php',
    1 => 'imagedashedline',
  ),
  'next' => 
  array (
    0 => 'function.imageellipse.php',
    1 => 'imageellipse',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/image/functions/imagedestroy.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imagedestroy" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagedestroy</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imagedestroy</span> &mdash; <span class="dc-title">销毁图像</span></p>

 </div>
 <div id="function.imagedestroy-refsynopsisdiv">
  <div class="warning"><strong class="warning">警告</strong><p class="simpara">此函数自 PHP 8.5.0
起<em>弃用</em>。强烈建议不要应用此函数。</p></div>
 </div>
 <div class="refsect1 description" id="refsect1-function.imagedestroy-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="attribute"><a href="class.deprecated.php">#[\Deprecated]</a> </span><br>
   <span class="methodname"><strong>imagedestroy</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.singleton.php" class="type true">true</a></span></div>

  <blockquote class="note"><p><strong class="note">注意</strong>: 
 <p class="para">
  此函数无效。在 PHP 8.0.0 之前，用于关闭资源。
 </p>
</p></blockquote>

  <p class="para">
   在 PHP 8.0.0 之前，<span class="function"><strong>imagedestroy()</strong></span> 会释放与 <code class="parameter">image</code>
   资源相关的所有内存。自 8.0.0 起，GD 扩展使用对象而不是资源，并且无法明确关闭对象。
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imagedestroy-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <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>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imagedestroy-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   总是返回 <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imagedestroy-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.5.0</td>
      <td>
       此函数已被弃用。
      </td>
     </tr>

     <tr>
      <td>8.0.0</td>
      <td>
       此函数现在是 <abbr>NOP（空操作）</abbr>。
      </td>
     </tr>

     <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.imagedestroy-examples">
  <h3 class="title">示例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>示例 #1 PHP 8.0.0 前使用 <span class="function"><strong>imagedestroy()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// 创建 100 x 100 图像<br /></span><span style="color: #0000BB">$im </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecreatetruecolor</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 /><br /></span><span style="color: #FF8000">// 修改或保存图像<br /><br />// 从内存中释放图像<br /></span><span style="color: #0000BB">imagedestroy</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>

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