# C1.Win.Document.Utils.WriteImageToStream

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_Document_Utils_WriteImageToStream_" data-uid="C1.Win.Document.Utils.WriteImageToStream*">WriteImageToStream Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_Document_Utils_WriteImageToStream_" data-uid="C1.Win.Document.Utils.WriteImageToStream*"></a>
<h4 id="C1_Win_Document_Utils_WriteImageToStream_System_Drawing_Image_System_Drawing_Imaging_ImageFormat_System_IO_Stream_" data-uid="C1.Win.Document.Utils.WriteImageToStream(System.Drawing.Image,System.Drawing.Imaging.ImageFormat,System.IO.Stream)">WriteImageToStream(Image, ImageFormat, Stream)</h4>
<div class="markdown level1 summary"><p>Writes specified image to 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 ImageFormat WriteImageToStream(Image image, ImageFormat imageFormat, Stream stream)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function WriteImageToStream(image As Image, imageFormat As ImageFormat, stream As Stream) As ImageFormat</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.drawing.image">Image</a></td>
      <td><span class="parametername">image</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.imaging.imageformat">ImageFormat</a></td>
      <td><span class="parametername">imageFormat</span></td>
      <td></td>
    </tr>
    <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></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="https://learn.microsoft.com/dotnet/api/system.drawing.imaging.imageformat">ImageFormat</a></td>
      <td><p>Returns null if error occurs during writing or <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.imaging.imageformat">ImageFormat</a> which was actually used to save an image.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
