Sophie

Sophie

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

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>Get an affine transformation matrix</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.imageaffinematrixconcat.html">imageaffinematrixconcat</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.imagealphablending.html">imagealphablending</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.imageaffinematrixget" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imageaffinematrixget</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.5.0, PHP 7)</p><p class="refpurpose"><span class="refname">imageaffinematrixget</span> &mdash; <span class="dc-title">Get an affine transformation matrix</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.imageaffinematrixget-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><strong>imageaffinematrixget</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$type</code></span>
   [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$options</code></span>
  ] )</div>

  <p class="para rdfs-comment">
   Returns an affine transformation matrix.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.imageaffinematrixget-parameters">
  <h3 class="title">Parameters</h3>
  <dl>

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

    <dd>

     <p class="para">
      One of the <strong><code>IMG_AFFINE_*</code></strong> constants.
     </p>
    </dd>

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

    <dd>

     <p class="para">
      If <code class="parameter">type</code> is <strong><code>IMG_AFFINE_TRANSLATE</code></strong>
      or <strong><code>IMG_AFFINE_SCALE</code></strong>,
      <code class="parameter">options</code> has to be an <span class="type"><a href="language.types.array.html" class="type array">array</a></span> with keys <em>x</em>
      and <em>y</em>, both having <span class="type"><a href="language.types.float.html" class="type float">float</a></span> values.
     </p>
     <p class="para">
      If <code class="parameter">type</code> is <strong><code>IMG_AFFINE_ROTATE</code></strong>,
      <strong><code>IMG_AFFINE_SHEAR_HORIZONTAL</code></strong> or <strong><code>IMG_AFFINE_SHEAR_VERTICAL</code></strong>,
      <code class="parameter">options</code> has to be a <span class="type"><a href="language.types.float.html" class="type float">float</a></span> specifying the angle.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.imageaffinematrixget-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   An affine transformation matrix (an array with keys
   <em>0</em> to <em>5</em> and float values)
    or <strong><code>FALSE</code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.imageaffinematrixget-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-3739">
    <p><strong>Example #1 <span class="function"><strong>imageaffinematrixget()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$matrix&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imageaffinematrixget</span><span style="color: #007700">(</span><span style="color: #0000BB">IMG_AFFINE_TRANSLATE</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #DD0000">'x'&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'y'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$matrix</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</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] =&gt; 1
    [1] =&gt; 0
    [2] =&gt; 0
    [3] =&gt; 1
    [4] =&gt; 2
    [5] =&gt; 3
)
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.imageaffinematrixget-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.imageaffine.html" class="function" rel="rdfs-seeAlso">imageaffine()</a> - Return an image containing the affine transformed src image, using an optional clipping area</span></li>
    <li class="member"><span class="function"><a href="function.imageaffinematrixconcat.html" class="function" rel="rdfs-seeAlso">imageaffinematrixconcat()</a> - Concatenate two affine transformation matrices</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="function.imageaffinematrixconcat.html">imageaffinematrixconcat</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.imagealphablending.html">imagealphablending</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>