# GrapeCity.Documents.Drawing.Image.FromStream

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Drawing_Image_FromStream_" data-uid="GrapeCity.Documents.Drawing.Image.FromStream*">FromStream Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Drawing_Image_FromStream_" data-uid="GrapeCity.Documents.Drawing.Image.FromStream*"></a>
<h4 id="GrapeCity_Documents_Drawing_Image_FromStream_System_IO_Stream_System_Boolean_System_Int32_" data-uid="GrapeCity.Documents.Drawing.Image.FromStream(System.IO.Stream,System.Boolean,System.Int32)">FromStream(Stream, bool, int)</h4>
<div class="markdown level1 summary"><p>Creates an <a class="xref" href="GrapeCity.Documents.Drawing.Image.html">Image</a> from a stream. JPEG, PNG, WEBP, GIF, BMP and TIFF formats are supported.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Image FromStream(Stream stream, bool ownStream = false, int frameIndex = 0)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function FromStream(stream As Stream, Optional ownStream As Boolean = False, Optional frameIndex As Integer = 0) As Image</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>The input stream.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">ownStream</span></td>
      <td><p>Indicates if the input stream should be closed when the <a class="xref" href="GrapeCity.Documents.Drawing.Image.html">Image</a> is disposed.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">frameIndex</span></td>
      <td><p>Index of an image frame to read, pass 0 for image formats not supporting multiple frames.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Drawing.Image.html">Image</a></td>
      <td><p>The newly created <a class="xref" href="GrapeCity.Documents.Drawing.Image.html">Image</a> object.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
