<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.imagick.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'imagick.setimageopacity.php',
    1 => 'Imagick::setImageOpacity',
    2 => 'Sets the image opacity level',
  ),
  'up' => 
  array (
    0 => 'class.imagick.php',
    1 => 'Imagick',
  ),
  'prev' => 
  array (
    0 => 'imagick.setimagemattecolor.php',
    1 => 'Imagick::setImageMatteColor',
  ),
  'next' => 
  array (
    0 => 'imagick.setimageorientation.php',
    1 => 'Imagick::setImageOrientation',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/imagick/imagick/setimageopacity.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="imagick.setimageopacity" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Imagick::setImageOpacity</h1>
  <p class="verinfo">(PECL imagick 2, PECL imagick 3)</p><p class="refpurpose"><span class="refname">Imagick::setImageOpacity</span> &mdash; <span class="dc-title">Sets the image opacity level</span></p>

 </div>

 <div id="imagick.setimageopacity-refsynopsisdiv">
   <div class="warning"><strong class="warning">警告</strong><p class="simpara">此函数在 Imagick 3.4.4 中被 <em>废弃</em>,强烈建议不要应用此函数。</p></div>
 </div>

 <div class="refsect1 description" id="refsect1-imagick.setimageopacity-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Imagick::setImageOpacity</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.float.php" class="type float">float</a></span> <code class="parameter">$opacity</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>


  <p class="para rdfs-comment">
   Sets the image to the specified opacity level. 此方法在Imagick基于ImageMagick 6.3.1以上版本编译时可用。
   This method operates on all channels, which means that for example opacity value
   of 0.5 will set all transparent areas to partially opaque. To add transparency to
   areas that are not already transparent use <a href="imagick.evaluateimage.php" class="link">Imagick::evaluateImage()</a>
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-imagick.setimageopacity-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">opacity</code></dt>
     <dd>
      <p class="para">
       The level of transparency: 1.0 is fully opaque and 0.0 is fully
       transparent.
      </p>
     </dd>
    
   </dl>
  </p>

 </div>

 <div class="refsect1 returnvalues" id="refsect1-imagick.setimageopacity-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 examples" id="refsect1-imagick.setimageopacity-examples">
  <h3 class="title">示例</h3>
  <p class="para">
   <div class="example" id="example-3073">
    <p><strong>示例 #1 A <span class="function"><strong>Imagick::setImageOpacity()</strong></span> example</strong></p>
    <div class="example-contents"><p>
     An example of using Imagick::setImageOpacity()
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/* Create the object */<br /></span><span style="color: #0000BB">$image </span><span style="color: #007700">= new </span><span style="color: #0000BB">Imagick</span><span style="color: #007700">(</span><span style="color: #DD0000">'source.png'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* Set the opacity */<br /></span><span style="color: #0000BB">$image</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setImageOpacity</span><span style="color: #007700">(</span><span style="color: #0000BB">0.7</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* output the image */<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-type: image/png'</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">$image</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

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


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