<?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 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.imagecreatefromgd2.php',
    1 => 'imagecreatefromgd2',
    2 => 'Create a new image from GD2 file or URL',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'GD- und Image-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.imagecreatefromgd.php',
    1 => 'imagecreatefromgd',
  ),
  'next' => 
  array (
    0 => 'function.imagecreatefromgd2part.php',
    1 => 'imagecreatefromgd2part',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/image/functions/imagecreatefromgd2.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imagecreatefromgd2" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagecreatefromgd2</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.7, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imagecreatefromgd2</span> &mdash; <span class="dc-title">Create a new image from GD2 file or URL</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imagecreatefromgd2-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagecreatefromgd2</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$filename</code></span>): <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">
   Create a new image from GD2 file or URL.
  </p>
  <div class="tip"><strong class="tip">Tipp</strong><p class="simpara">Wenn
<a href="filesystem.configuration.php#ini.allow-url-fopen" class="link">fopen wrappers</a> aktiviert ist, kann
mit dieser Funktion eine URL als Dateiname verwendet werden. Mehr Details dazu,
wie der Dateiname angeben werden muss, sind bei <span class="function"><a href="function.fopen.php" class="function">fopen()</a></span> zu
finden. Eine Liste der unterstützten URL-Protokolle, die Fähigkeiten der
verschiedenen Wrapper, Hinweise zu deren Verwendung und Informationen zu den
eventuell vorhandenen vordefinierten Variablen sind unter
<a href="wrappers.php" class="xref">Unterst&uuml;tzte Protokolle und Wrapper</a> zu finden.</p></div>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imagecreatefromgd2-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">filename</code></dt>
     <dd>
      <p class="para">
       Path to the GD2 image.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imagecreatefromgd2-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">Gibt im Erfolgsfall eine Bildobjekt zurück, im Fehlerfall <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.</p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imagecreatefromgd2-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Beschreibung</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <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>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.imagecreatefromgd2-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 <span class="function"><strong>imagecreatefromgd2()</strong></span> 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">// Load the gd2 image<br /></span><span style="color: #0000BB">$im </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecreatefromgd2</span><span style="color: #007700">(</span><span style="color: #DD0000">'./test.gd2'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Apply an effect on the image, in this <br />// case negate the image<br /></span><span style="color: #007700">if(</span><span style="color: #0000BB">function_exists</span><span style="color: #007700">(</span><span style="color: #DD0000">'imagefilter'</span><span style="color: #007700">))<br />{<br />    </span><span style="color: #0000BB">imagefilter</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">IMG_FILTER_NEGATE</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #FF8000">// Save the image<br /></span><span style="color: #0000BB">imagegd2</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #DD0000">'./test_updated.gd2'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

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


 <div class="refsect1 notes" id="refsect1-function.imagecreatefromgd2-notes">
  <h3 class="title">Anmerkungen</h3>
  <div class="warning"><strong class="warning">Warnung</strong><p class="simpara">Die Bildformate
GD und GD2 sind proprietäre Bildformate von libgd. Sie sind als <em>veraltet</em>
anzusehen, und sollten nur zu Entwicklungs- und Testzwecken verwendet werden.</p></div>
 </div>


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