# C1.C1Pdf.C1PdfDocument.DrawImage

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_C1Pdf_C1PdfDocument_DrawImage_" data-uid="C1.C1Pdf.C1PdfDocument.DrawImage*">DrawImage Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_C1Pdf_C1PdfDocument_DrawImage_" data-uid="C1.C1Pdf.C1PdfDocument.DrawImage*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawImage_System_Drawing_Image_System_Drawing_RectangleF_System_Drawing_ContentAlignment_C1_C1Pdf_ImageSizeModeEnum_" data-uid="C1.C1Pdf.C1PdfDocument.DrawImage(System.Drawing.Image,System.Drawing.RectangleF,System.Drawing.ContentAlignment,C1.C1Pdf.ImageSizeModeEnum)">DrawImage(Image, RectangleF, ContentAlignment, ImageSizeModeEnum)</h4>
<div class="markdown level1 summary"><p>Draws the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.image">Image</a> object at the specified location,
adjusting the image size as specified by the <code class="paramref">align</code> and
<code class="paramref">mode</code> parameters.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void DrawImage(Image img, RectangleF rc, ContentAlignment align, ImageSizeModeEnum mode)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub DrawImage(img As Image, rc As RectangleF, align As ContentAlignment, mode As ImageSizeModeEnum)</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">img</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.image">Image</a> object to draw.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a></td>
      <td><span class="parametername">rc</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a> structure that specifies the location of the drawn image, in points from the top left corner of the page.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.contentalignment">ContentAlignment</a></td>
      <td><span class="parametername">align</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.contentalignment">ContentAlignment</a> value that specifies how the image should be aligned within the rectangle.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.C1Pdf.ImageSizeModeEnum.html">ImageSizeModeEnum</a></td>
      <td><span class="parametername">mode</span></td>
      <td><p><a class="xref" href="C1.C1Pdf.ImageSizeModeEnum.html">ImageSizeModeEnum</a> value that specifies how the image should be sized to fit the rectangle.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Pdf_C1PdfDocument_DrawImage_" data-uid="C1.C1Pdf.C1PdfDocument.DrawImage*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawImage_System_Drawing_Image_System_Drawing_RectangleF_" data-uid="C1.C1Pdf.C1PdfDocument.DrawImage(System.Drawing.Image,System.Drawing.RectangleF)">DrawImage(Image, RectangleF)</h4>
<div class="markdown level1 summary"><p>Draws the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.image">Image</a> object at the specified location,
stretching it to fit the destination rectangle.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void DrawImage(Image img, RectangleF rc)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub DrawImage(img As Image, rc As RectangleF)</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">img</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.image">Image</a> object to draw.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a></td>
      <td><span class="parametername">rc</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a> structure that specifies the location of the drawn image, in points from the top left corner of the page.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_C1Pdf_C1PdfDocument_DrawImage_System_Drawing_Image_System_Drawing_RectangleF__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The <b>DrawImage</b> method can be used to render bitmaps and metafiles. When used with
metafiles, it enumerates the drawing commands in the metafile and translates them into low-level
drawing primitives. This results in resolution-independent images.</p>
</div>


<a id="C1_C1Pdf_C1PdfDocument_DrawImage_" data-uid="C1.C1Pdf.C1PdfDocument.DrawImage*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawImage_System_Drawing_Image_System_Drawing_RectangleF_System_Drawing_RectangleF_" data-uid="C1.C1Pdf.C1PdfDocument.DrawImage(System.Drawing.Image,System.Drawing.RectangleF,System.Drawing.RectangleF)">DrawImage(Image, RectangleF, RectangleF)</h4>
<div class="markdown level1 summary"><p>Draws the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.image">Image</a> object at the specified location,
clipping the output to the given clipping rectangle.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void DrawImage(Image img, RectangleF rcImage, RectangleF rcClip)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub DrawImage(img As Image, rcImage As RectangleF, rcClip As RectangleF)</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">img</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.image">Image</a> object to draw.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a></td>
      <td><span class="parametername">rcImage</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a> structure that specifies the location of the drawn image, in points from the top left corner of the page.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a></td>
      <td><span class="parametername">rcClip</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a> structure that specifies a clipping rectangle on the page. No part of the image is drawn outside the clipping rectangle.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
