# GrapeCity.Documents.Drawing.Image.FromFile

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Drawing_Image_FromFile_" data-uid="GrapeCity.Documents.Drawing.Image.FromFile*">FromFile Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Drawing_Image_FromFile_" data-uid="GrapeCity.Documents.Drawing.Image.FromFile*"></a>
<h4 id="GrapeCity_Documents_Drawing_Image_FromFile_System_String_GrapeCity_Documents_Drawing_ImageBinding_System_Int32_" data-uid="GrapeCity.Documents.Drawing.Image.FromFile(System.String,GrapeCity.Documents.Drawing.ImageBinding,System.Int32)">FromFile(string, ImageBinding, int)</h4>
<div class="markdown level1 summary"><p>Creates an <a class="xref" href="GrapeCity.Documents.Drawing.Image.html">Image</a> from a file. JPEG, PNG, WEBP, GIF, BMP and TIFF formats are supported.</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 FromFile(string path, ImageBinding binding = ImageBinding.FilePath, int frameIndex = 0)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function FromFile(path As String, Optional binding As ImageBinding = ImageBinding.FilePath, Optional frameIndex As Integer = 0) As Image</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">path</span></td>
      <td><p>The file path to the image.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Drawing.ImageBinding.html">ImageBinding</a></td>
      <td><span class="parametername">binding</span></td>
      <td><p>Specifies how the image data is attached to the <a class="xref" href="GrapeCity.Documents.Drawing.Image.html">Image</a> object.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">frameIndex</span></td>
      <td><p>Index of an image frame to read, pass 0 for image formats not supporting multiple frames.</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.Documents.Drawing.Image.html">Image</a></td>
      <td><p>The newly created <a class="xref" href="GrapeCity.Documents.Drawing.Image.html">Image</a> object.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
