Sophie

Sophie

distrib > Mageia > 7 > aarch64 > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 8538

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>Sets the overall canvas size</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="imagickdraw.setvectorgraphics.html">ImagickDraw::setVectorGraphics</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="imagickdraw.skewx.html">ImagickDraw::skewX</a></div>
 <div class="up"><a href="class.imagickdraw.html">ImagickDraw</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="imagickdraw.setviewbox" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ImagickDraw::setViewbox</h1>
  <p class="verinfo">(PECL imagick 2.0.0)</p><p class="refpurpose"><span class="refname">ImagickDraw::setViewbox</span> &mdash; <span class="dc-title">Sets the overall canvas size</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-imagickdraw.setviewbox-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>ImagickDraw::setViewbox</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$x1</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$y1</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$x2</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$y2</code></span>
   )</div>

  <div class="warning"><strong class="warning">Warning</strong><p class="simpara">This function is
currently not documented; only its argument list is available.
</p></div>
  <p class="para">
   Sets the overall canvas size to be recorded with the drawing vector data.
   Usually this will be specified using the same size as the canvas image.
   When the vector data is saved to SVG or MVG formats, the viewbox is use to
   specify the size of the canvas image that a viewer will render the vector
   data on.
  </p>
 </div>


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

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

     <dd>

      <p class="para">
       left x coordinate
      </p>
     </dd>

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

     <dd>

      <p class="para">
       left y coordinate
      </p>
     </dd>

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

     <dd>

      <p class="para">
       right x coordinate
      </p>
     </dd>

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

     <dd>

      <p class="para">
       right y coordinate
      </p>
     </dd>

    
   </dl>

  </p>

 </div>

 <div class="refsect1 returnvalues" id="refsect1-imagickdraw.setviewbox-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   No value is returned.
  </p>
 </div>




 <div class="refsect1 examples" id="refsect1-imagickdraw.setviewbox-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
    <div class="example" id="example-4111">
      <p><strong>Example #1  <span class="function"><strong>ImagickDraw::setViewBox()</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: #007700">function&nbsp;</span><span style="color: #0000BB">setViewBox</span><span style="color: #007700">(</span><span style="color: #0000BB">$strokeColor</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$fillColor</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$backgroundColor</span><span style="color: #007700">)&nbsp;{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$draw&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;\</span><span style="color: #0000BB">ImagickDraw</span><span style="color: #007700">();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$draw</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setStrokeColor</span><span style="color: #007700">(</span><span style="color: #0000BB">$strokeColor</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$draw</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setFillColor</span><span style="color: #007700">(</span><span style="color: #0000BB">$fillColor</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$draw</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setStrokeWidth</span><span style="color: #007700">(</span><span style="color: #0000BB">2</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$draw</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setFontSize</span><span style="color: #007700">(</span><span style="color: #0000BB">72</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;Sets&nbsp;the&nbsp;overall&nbsp;canvas&nbsp;size&nbsp;to&nbsp;be&nbsp;recorded&nbsp;with&nbsp;the&nbsp;drawing&nbsp;vector&nbsp;data.&nbsp;Usually&nbsp;this&nbsp;will&nbsp;be&nbsp;specified&nbsp;using&nbsp;the&nbsp;same&nbsp;size&nbsp;as&nbsp;the&nbsp;canvas&nbsp;image.&nbsp;When&nbsp;the&nbsp;vector&nbsp;data&nbsp;is&nbsp;saved&nbsp;to&nbsp;SVG&nbsp;or&nbsp;MVG&nbsp;formats,&nbsp;the&nbsp;viewbox&nbsp;is&nbsp;use&nbsp;to&nbsp;specify&nbsp;the&nbsp;size&nbsp;of&nbsp;the&nbsp;canvas&nbsp;image&nbsp;that&nbsp;a&nbsp;viewer&nbsp;will&nbsp;render&nbsp;the&nbsp;vector&nbsp;data&nbsp;on.<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$draw</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">circle</span><span style="color: #007700">(</span><span style="color: #0000BB">250</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">250</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">250</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$draw</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setviewbox</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">200</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">200</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$draw</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">circle</span><span style="color: #007700">(</span><span style="color: #0000BB">125</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">250</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">250</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">250</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$draw</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">translate</span><span style="color: #007700">(</span><span style="color: #0000BB">250</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">125</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$draw</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">circle</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">125</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$imagick&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;\</span><span style="color: #0000BB">Imagick</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">newImage</span><span style="color: #007700">(</span><span style="color: #0000BB">500</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">500</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$backgroundColor</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setImageFormat</span><span style="color: #007700">(</span><span style="color: #DD0000">"png"</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">drawImage</span><span style="color: #007700">(</span><span style="color: #0000BB">$draw</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"Content-Type:&nbsp;image/png"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getImageBlob</span><span style="color: #007700">();<br />}<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
      </div>

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


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="imagickdraw.setvectorgraphics.html">ImagickDraw::setVectorGraphics</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="imagickdraw.skewx.html">ImagickDraw::skewX</a></div>
 <div class="up"><a href="class.imagickdraw.html">ImagickDraw</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>