<?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 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.imagescale.php',
    1 => 'imagescale',
    2 => 'Scale an image using the given new width and height',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'GD and Image Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.imagesavealpha.php',
    1 => 'imagesavealpha',
  ),
  'next' => 
  array (
    0 => 'function.imagesetbrush.php',
    1 => 'imagesetbrush',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/image/functions/imagescale.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imagescale" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagescale</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.5.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imagescale</span> &mdash; <span class="dc-title">Scale an image using the given new width and height</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.imagescale-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagescale</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="class.gdimage.php" class="type GdImage">GdImage</a></span> <code class="parameter">$image</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$width</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$height</code><span class="initializer"> = -1</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$mode</code><span class="initializer"> = <strong><code><a href="image.constants.php#constant.img-bilinear-fixed">IMG_BILINEAR_FIXED</a></code></strong></span></span><br>): <span class="type"><span class="type"><a href="class.gdimage.php" class="type GdImage">GdImage</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>imagescale()</strong></span> scales an image using the given
   interpolation algorithm.
  </p>
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <p class="para">
    Unlike many of other image functions, <span class="function"><strong>imagescale()</strong></span> does
    not modify the passed <code class="parameter">image</code>; instead, a
    <em>new</em> image is returned.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.imagescale-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <dl>
   <dt><code class="parameter">
image</code></dt><dd><p class="para">Una risorsa immagine, restituita da una delle funzioni di creazione immagine, 
come <span class="function"><a href="function.imagecreatetruecolor.php" class="function">imagecreatetruecolor()</a></span>.</p></dd>
   
    <dt><code class="parameter">width</code></dt>
    <dd>
     <p class="para">
      The width to scale the image to.
     </p>
    </dd>
   
   
    <dt><code class="parameter">height</code></dt>
    <dd>
     <p class="para">
      The height to scale the image to. If omitted or negative, the aspect
      ratio will be preserved.
     </p>
    </dd>
   
   
    <dt><code class="parameter">mode</code></dt>
    <dd>
     <p class="para">
      One of <strong><code><a href="image.constants.php#constant.img-nearest-neighbour">IMG_NEAREST_NEIGHBOUR</a></code></strong>,
      <strong><code><a href="image.constants.php#constant.img-bilinear-fixed">IMG_BILINEAR_FIXED</a></code></strong>,
      <strong><code><a href="image.constants.php#constant.img-bicubic">IMG_BICUBIC</a></code></strong>,
      <strong><code><a href="image.constants.php#constant.img-bicubic-fixed">IMG_BICUBIC_FIXED</a></code></strong> or anything else (will use two
      pass).
      <blockquote class="note"><p><strong class="note">Nota</strong>: 
       <span class="simpara">
        <strong><code><a href="image.constants.php#constant.img-weighted4">IMG_WEIGHTED4</a></code></strong> is not yet supported.
       </span>
      </p></blockquote>
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.imagescale-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   Return the scaled image object on success o <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> in caso di fallimento.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.imagescale-errors">
  <h3 class="title">Errori/Eccezioni</h3>
  <p class="simpara">
   Throws a <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> if <code class="parameter">width</code>
   or <code class="parameter">height</code> would cause over-/underflow.
  </p>
  <p class="simpara">
   Throws a <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> if <code class="parameter">mode</code> is invalid.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imagescale-changelog">
  <h3 class="title">Log delle modifiche</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Versione</th>
      <th>Descrizione</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.4.0</td>
      <td>
       Now throws a <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> if <code class="parameter">width</code>
       or <code class="parameter">height</code> would cause over-/underflow.
      </td>
     </tr>

     <tr>
      <td>8.4.0</td>
      <td>
       Now throws a <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> if <code class="parameter">mode</code> is invalid.
      </td>
     </tr>

     <tr>
      <td>8.0.0</td>
      <td>
       On success, this function returns a <span class="classname"><a href="class.gdimage.php" class="classname">GDImage</a></span> instance now;
       previously, a <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> was returned.
      </td>
     </tr>

     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">image</code> expects a <span class="classname"><a href="class.gdimage.php" class="classname">GdImage</a></span>
  instance now; previously, a valid <code class="literal">gd</code> <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> was expected.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.imagescale-seealso">
  <h3 class="title">Vedere anche:</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.imagecopyresized.php" class="function" rel="rdfs-seeAlso">imagecopyresized()</a> - Copy and resize part of an image</span></li>
   <li><span class="function"><a href="function.imagecopyresampled.php" class="function" rel="rdfs-seeAlso">imagecopyresampled()</a> - Copy and resize part of an image with resampling</span></li>
  </ul>
 </div>


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