# GrapeCity.ActiveReports.Document.Drawing.Image.FromStream

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_ActiveReports_Document_Drawing_Image_FromStream_" data-uid="GrapeCity.ActiveReports.Document.Drawing.Image.FromStream*">FromStream Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_ActiveReports_Document_Drawing_Image_FromStream_" data-uid="GrapeCity.ActiveReports.Document.Drawing.Image.FromStream*"></a>
<h4 id="GrapeCity_ActiveReports_Document_Drawing_Image_FromStream_System_IO_Stream_" data-uid="GrapeCity.ActiveReports.Document.Drawing.Image.FromStream(System.IO.Stream)">FromStream(Stream)</h4>
<div class="markdown level1 summary"><p>Creates an <a class="xref" href="GrapeCity.ActiveReports.Document.Drawing.Image.html">Image</a> from the specified data stream.</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)</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 image stream.</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.ActiveReports.Document.Drawing.Image.html">Image</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Document_Drawing_Image_FromStream_System_IO_Stream__examples">Examples</h5>
<p>This example shows how to restore an <a class="xref" href="GrapeCity.ActiveReports.Document.Drawing.Image.html">Image</a> from a manually created stream.</p>
<pre><code class="lang-csharp">using (System.Drawing.Image imgSrc = new Bitmap(12, 12))
{
	using (Graphics g1 = Graphics.FromImage(imgSrc))
		g1.FillRectangle(Brushes.Yellow, new Rectangle(0, 0, 12, 12));
	MemoryStream stream1 = new MemoryStream();
	img1.Save(stream1, ImageFormat.Jpeg);
	return Image.FromStream(stream1);
}</code></pre>

</div>
