Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 8091

php-manual-en-7.2.11-1.mga7.noarch.rpm

<!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>Composite one image onto another</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="imagick.compareimages.html">Imagick::compareImages</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="imagick.construct.html">Imagick::__construct</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.compositeimage" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Imagick::compositeImage</h1>
  <p class="verinfo">(PECL imagick 2.0.0)</p><p class="refpurpose"><span class="refname">Imagick::compositeImage</span> &mdash; <span class="dc-title">Composite one image onto another</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-imagick.compositeimage-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>Imagick::compositeImage</strong></span>
    ( <span class="methodparam"><span class="type"><a href="class.imagick.html" class="type Imagick">Imagick</a></span> <code class="parameter">$composite_object</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$composite</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$x</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$y</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$channel</code><span class="initializer"> = Imagick::CHANNEL_DEFAULT</span></span>
  ] )</div>

  <p class="para rdfs-comment">
   Composite one image onto another at the specified offset. Any extra arguments needed for the compose algorithm should passed to setImageArtifact with &#039;compose:args&#039; as the first parameter and the data as the second parameter.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-imagick.compositeimage-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">composite_object</code></dt>

     <dd>

      <p class="para">
       Imagick object which holds the composite image
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">compose</code></dt>

     <dd>

      <p class="para">
       Composite operator. See <a href="imagick.constants.html#imagick.constants.compositeop" class="link">Composite Operator
       Constants</a>
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">x</code></dt>

     <dd>

      <p class="para">
       The column offset of the composited image
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">y</code></dt>

     <dd>

      <p class="para">
       The row offset of the composited image
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">channel</code></dt>

     <dd>

      <p class="para">
       Provide any channel constant that is valid for your channel mode. To
       apply to more than one channel, combine channeltype constants using
       bitwise operators. Refer to this list of <a href="imagick.constants.html#imagick.constants.channel" class="link">channel constants</a>.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-imagick.compositeimage-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> on success.
  </p>
 </div>


  <div class="refsect1 examples" id="refsect1-imagick.compositeimage-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-3899">
    <p><strong>Example #1 Using <span class="function"><strong>Imagick::compositeImage()</strong></span>:</strong></p>
    <div class="example-contents"><p>
     Composite two images with the &#039;mathematics&#039; compose method
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">//&nbsp;Equivalent&nbsp;to&nbsp;running&nbsp;the&nbsp;command<br />//&nbsp;convert&nbsp;src1.png&nbsp;src2.png&nbsp;-compose&nbsp;mathematics&nbsp;-define&nbsp;compose:args="1,0,-0.5,0.5"&nbsp;-composite&nbsp;output.png<br /><br /></span><span style="color: #0000BB">$src1&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;\</span><span style="color: #0000BB">Imagick</span><span style="color: #007700">(</span><span style="color: #DD0000">"./src1.png"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$src2&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;\</span><span style="color: #0000BB">Imagick</span><span style="color: #007700">(</span><span style="color: #DD0000">"./src2.png"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$src1</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setImageVirtualPixelMethod</span><span style="color: #007700">(</span><span style="color: #0000BB">Imagick</span><span style="color: #007700">::</span><span style="color: #0000BB">VIRTUALPIXELMETHOD_TRANSPARENT</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$src1</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setImageArtifact</span><span style="color: #007700">(</span><span style="color: #DD0000">'compose:args'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"1,0,-0.5,0.5"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$src1</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">compositeImage</span><span style="color: #007700">(</span><span style="color: #0000BB">$src2</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">Imagick</span><span style="color: #007700">::</span><span style="color: #0000BB">COMPOSITE_MATHEMATICS</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$src1</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">writeImage</span><span style="color: #007700">(</span><span style="color: #DD0000">"./output.png"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

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

 
 <div class="refsect1 seealso" id="refsect1-imagick.compositeimage-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="imagick.setimageartifact.html" class="function" rel="rdfs-seeAlso">Imagick::setImageArtifact()</a> - Set image artifact</span></li>
   </ul>
  </p>
 </div>

 
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="imagick.compareimages.html">Imagick::compareImages</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="imagick.construct.html">Imagick::__construct</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>