# GrapeCity.Spreadsheet.Drawing.IShapes.AddPicture

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_Drawing_IShapes_AddPicture_" data-uid="GrapeCity.Spreadsheet.Drawing.IShapes.AddPicture*">AddPicture Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_Drawing_IShapes_AddPicture_" data-uid="GrapeCity.Spreadsheet.Drawing.IShapes.AddPicture*"></a>
<h4 id="GrapeCity_Spreadsheet_Drawing_IShapes_AddPicture_System_String_System_Boolean_System_Boolean_System_Double_System_Double_System_Double_System_Double_" data-uid="GrapeCity.Spreadsheet.Drawing.IShapes.AddPicture(System.String,System.Boolean,System.Boolean,System.Double,System.Double,System.Double,System.Double)">AddPicture(string, bool, bool, double, double, double, double)</h4>
<div class="markdown level1 summary"><p>Creates a picture from an existing file.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">IShape AddPicture(string fileName, bool linkToFile, bool saveWithDocument, double x, double y, double width = NaN, double height = NaN)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function AddPicture(fileName As String, linkToFile As Boolean, saveWithDocument As Boolean, x As Double, y As Double, Optional width As Double = NaN, Optional height As Double = NaN) As IShape</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 file from which the picture is to be created.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">linkToFile</span></td>
      <td><p>The file to link to.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">saveWithDocument</span></td>
      <td><p>To save the picture with the document.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">x</span></td>
      <td><p>The position (in pixels) of the upper-left corner of the picture relative to the upper-left corner of the document.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">y</span></td>
      <td><p>The position (in pixels) of the upper-left corner of the picture relative to the upper-left corner of the document.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>The width of the picture, in pixels.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>The height of the picture, in pixels.</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.Spreadsheet.Drawing.IShape.html">IShape</a></td>
      <td><p>The new picture.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
