<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.ps.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.ps-open-image.php',
    1 => 'ps_open_image',
    2 => 'Reads an image for later placement',
  ),
  'up' => 
  array (
    0 => 'ref.ps.php',
    1 => 'PS Functions',
  ),
  'prev' => 
  array (
    0 => 'function.ps-open-file.php',
    1 => 'ps_open_file',
  ),
  'next' => 
  array (
    0 => 'function.ps-open-image-file.php',
    1 => 'ps_open_image_file',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ps/functions/ps-open-image.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.ps-open-image" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ps_open_image</h1>
  <p class="verinfo">(PECL ps &gt;= 1.1.0)</p><p class="refpurpose"><span class="refname">ps_open_image</span> &mdash; <span class="dc-title">Reads an image for later placement</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.ps-open-image-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ps_open_image</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$psdoc</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$type</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$source</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$data</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">$length</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>,<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">$components</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">$bpc</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$params</code></span><br>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

   <p class="para rdfs-comment">
    Reads an image which is already available in memory. The parameter
    <code class="parameter">source</code> is currently not evaluated and assumed to be
    <code class="literal">memory</code>. The image data is a sequence of pixels starting
    in th upper left corner and ending in the lower right corner. Each pixel
    consists of <code class="parameter">components</code> color components, and each
    component has <code class="parameter">bpc</code> bits.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ps-open-image-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">psdoc</code></dt>
     <dd>
      <p class="para">
       Resource identifier of the postscript file
       as returned by <span class="function"><a href="function.ps-new.php" class="function">ps_new()</a></span>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">type</code></dt>
     <dd>
      <p class="para">
       The type of the image. Possible values are <code class="literal">png</code>,
       <code class="literal">jpeg</code>, or <code class="literal">eps</code>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">source</code></dt>
     <dd>
      <p class="para">
       Not used.
      </p>
     </dd>
    
    
     <dt><code class="parameter">data</code></dt>
     <dd>
      <p class="para">
       The image data.
      </p>
     </dd>
    
    
     <dt><code class="parameter">length</code></dt>
     <dd>
      <p class="para">
       The length of the image data.
      </p>
     </dd>
    
    
     <dt><code class="parameter">width</code></dt>
     <dd>
      <p class="para">
       The width of the image.
      </p>
     </dd>
    
    
     <dt><code class="parameter">height</code></dt>
     <dd>
      <p class="para">
       The height of the image.
      </p>
     </dd>
    
    
     <dt><code class="parameter">components</code></dt>
     <dd>
      <p class="para">
       The number of components for each pixel. This can be
       1 (gray scale images), 3 (rgb images), or 4 (cmyk, rgba images).
      </p>
     </dd>
    
    
     <dt><code class="parameter">bpc</code></dt>
     <dd>
      <p class="para">
       Number of bits per component (quite often 8).
      </p>
     </dd>
    
    
     <dt><code class="parameter">params</code></dt>
     <dd>
      <p class="para">
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ps-open-image-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns identifier of image or zero in case of an error. The identifier is
   a positive number greater than 0.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.ps-open-image-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.ps-open-image-file.php" class="function" rel="rdfs-seeAlso">ps_open_image_file()</a> - Opens image from file</span></li>
    <li><span class="function"><a href="function.ps-place-image.php" class="function" rel="rdfs-seeAlso">ps_place_image()</a> - Places image on the page</span></li>
    <li><span class="function"><a href="function.ps-close-image.php" class="function" rel="rdfs-seeAlso">ps_close_image()</a> - Closes image and frees memory</span></li>
   </ul>
  </p>
 </div>

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