# GrapeCity.Spreadsheet.Drawing.IPicture.ChangeImage

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_Drawing_IPicture_ChangeImage_" data-uid="GrapeCity.Spreadsheet.Drawing.IPicture.ChangeImage*">ChangeImage Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_Drawing_IPicture_ChangeImage_" data-uid="GrapeCity.Spreadsheet.Drawing.IPicture.ChangeImage*"></a>
<h4 id="GrapeCity_Spreadsheet_Drawing_IPicture_ChangeImage_System_String_GrapeCity_Drawing_AspectRatio_" data-uid="GrapeCity.Spreadsheet.Drawing.IPicture.ChangeImage(System.String,GrapeCity.Drawing.AspectRatio)">ChangeImage(string, AspectRatio)</h4>
<div class="markdown level1 summary"><p>Replaces the current image with a different image.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void ChangeImage(string fileName, AspectRatio aspect = (AspectRatio)255)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub ChangeImage(fileName As String, Optional aspect As AspectRatio = 255)</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.string">string</a></td>
      <td><span class="parametername">fileName</span></td>
      <td><p>The path to the new image.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Drawing.AspectRatio.html">AspectRatio</a></td>
      <td><span class="parametername">aspect</span></td>
      <td><p>Specifies how to resize the new image. If omitted, the original height is kept.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Spreadsheet_Drawing_IPicture_ChangeImage_" data-uid="GrapeCity.Spreadsheet.Drawing.IPicture.ChangeImage*"></a>
<h4 id="GrapeCity_Spreadsheet_Drawing_IPicture_ChangeImage_System_IO_Stream_GrapeCity_Drawing_AspectRatio_" data-uid="GrapeCity.Spreadsheet.Drawing.IPicture.ChangeImage(System.IO.Stream,GrapeCity.Drawing.AspectRatio)">ChangeImage(Stream, AspectRatio)</h4>
<div class="markdown level1 summary"><p>Replaces the current image with a different image.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void ChangeImage(Stream stream, AspectRatio aspect = (AspectRatio)255)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub ChangeImage(stream As Stream, Optional aspect As AspectRatio = 255)</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 data.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Drawing.AspectRatio.html">AspectRatio</a></td>
      <td><span class="parametername">aspect</span></td>
      <td><p>Specifies how to resize the new image. If omitted, the original height is kept.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Spreadsheet_Drawing_IPicture_ChangeImage_" data-uid="GrapeCity.Spreadsheet.Drawing.IPicture.ChangeImage*"></a>
<h4 id="GrapeCity_Spreadsheet_Drawing_IPicture_ChangeImage_System_Byte___GrapeCity_Drawing_AspectRatio_" data-uid="GrapeCity.Spreadsheet.Drawing.IPicture.ChangeImage(System.Byte[],GrapeCity.Drawing.AspectRatio)">ChangeImage(byte[], AspectRatio)</h4>
<div class="markdown level1 summary"><p>Replaces the current image with a different image.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void ChangeImage(byte[] data, AspectRatio aspect = (AspectRatio)255)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub ChangeImage(data As Byte(), Optional aspect As AspectRatio = 255)</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.byte">byte</a>[]</td>
      <td><span class="parametername">data</span></td>
      <td><p>The image data.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Drawing.AspectRatio.html">AspectRatio</a></td>
      <td><span class="parametername">aspect</span></td>
      <td><p>Specifies how to resize the new image. If omitted, the original height is kept.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
