<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.gmagick.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'gmagick.examples.php',
    1 => 'Esempi',
    2 => 'Esempi',
  ),
  'up' => 
  array (
    0 => 'book.gmagick.php',
    1 => 'Gmagick',
  ),
  'prev' => 
  array (
    0 => 'gmagick.constants.php',
    1 => 'Costanti predefinite',
  ),
  'next' => 
  array (
    0 => 'class.gmagick.php',
    1 => 'Gmagick',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/gmagick/examples.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="gmagick.examples" class="chapter">
 <h1 class="title">Esempi</h1>

 <p class="simpara">
  The following shows some common Gmagick image operations.
 </p>
 <div class="example" id="example-1">
  <p><strong>Example #1 Gmagick Example</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: #FF8000">//Instantiate a new Gmagick object<br /></span><span style="color: #0000BB">$image </span><span style="color: #007700">= new </span><span style="color: #0000BB">Gmagick</span><span style="color: #007700">(</span><span style="color: #DD0000">'example.jpg'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//Make thumbnail from image loaded. 0 for either axes preserves aspect ratio<br /></span><span style="color: #0000BB">$image</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">thumbnailimage</span><span style="color: #007700">(</span><span style="color: #0000BB">100</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//Create a border around the image, then simulate how the image will look like as an oil painting<br />//Notice the chaining of mutator methods which is supported in gmagick<br /></span><span style="color: #0000BB">$image</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">borderimage</span><span style="color: #007700">(</span><span style="color: #DD0000">"yellow"</span><span style="color: #007700">, </span><span style="color: #0000BB">8</span><span style="color: #007700">, </span><span style="color: #0000BB">8</span><span style="color: #007700">)-&gt;</span><span style="color: #0000BB">oilpaintimage</span><span style="color: #007700">(</span><span style="color: #0000BB">0.3</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//Write the current image at the current state to a file<br /></span><span style="color: #0000BB">$image</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">write</span><span style="color: #007700">(</span><span style="color: #DD0000">'example_thumbnail.jpg'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
  </div>

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