# C1.Win.Document.Utils.WriteMetafileToStream

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_Document_Utils_WriteMetafileToStream_" data-uid="C1.Win.Document.Utils.WriteMetafileToStream*">WriteMetafileToStream Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_Document_Utils_WriteMetafileToStream_" data-uid="C1.Win.Document.Utils.WriteMetafileToStream*"></a>
<h4 id="C1_Win_Document_Utils_WriteMetafileToStream_System_Drawing_Imaging_Metafile_System_IO_Stream_" data-uid="C1.Win.Document.Utils.WriteMetafileToStream(System.Drawing.Imaging.Metafile,System.IO.Stream)">WriteMetafileToStream(Metafile, Stream)</h4>
<div class="markdown level1 summary"><p>Serializes a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.imaging.metafile">Metafile</a> to a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static bool WriteMetafileToStream(Metafile metafile, Stream stream)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function WriteMetafileToStream(metafile As Metafile, stream As Stream) As Boolean</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.imaging.metafile">Metafile</a></td>
      <td><span class="parametername">metafile</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.imaging.metafile">Metafile</a> to serialize.</p>
</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><p>The target <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a>.</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="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p>True if metafile was successfully saved.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_Document_Utils_WriteMetafileToStream_System_Drawing_Imaging_Metafile_System_IO_Stream__seealso">See Also</h5>
<div class="seealso">
    <div><a class="xref" href="C1.Win.Document.Utils.WriteMetafileToMemory.html#C1_Win_Document_Utils_WriteMetafileToMemory_System_Drawing_Imaging_Metafile_">WriteMetafileToMemory</a>(<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.imaging.metafile">Metafile</a>)</div>
    <div><a class="xref" href="C1.Win.Document.Utils.WriteMetafileToFile.html#C1_Win_Document_Utils_WriteMetafileToFile_System_Drawing_Imaging_Metafile_System_String_">WriteMetafileToFile</a>(<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.imaging.metafile">Metafile</a>, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>)</div>
</div>
</div>
