# C1.C1Excel.XLPictureShape.-ctor

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_C1Excel_XLPictureShape__ctor_" data-uid="C1.C1Excel.XLPictureShape.#ctor*">XLPictureShape Constructor
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_C1Excel_XLPictureShape__ctor_" data-uid="C1.C1Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_C1Excel_XLPictureShape__ctor_System_Drawing_Image_System_Int32_System_Int32_" data-uid="C1.C1Excel.XLPictureShape.#ctor(System.Drawing.Image,System.Int32,System.Int32)">XLPictureShape(Image, int, int)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public XLPictureShape(Image img, int x, int y)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(img As Image, x As Integer, y As Integer)</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>The image contained in the new <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">x</span></td>
      <td><p>The horizontal position of the new shape with respect to the cell, in twips.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">y</span></td>
      <td><p>The vertical position of the new shape with respect to the cell, in twips.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_C1Excel_XLPictureShape__ctor_System_Drawing_Image_System_Int32_System_Int32__examples">Examples</h5>
<p>The code below adds an image to a cell. The image is rendered in its original size, and is
indented from the top left corner of the cell by 30 twips:</p>
<pre><code class="lang-csharp">// get sheet and cell
XLSheet sheet = c1ExcelBook1.Sheets[0];
XLCell  cell  = sheet[row, col];

// build XLPictureShape
XLPictureShape pic = new XLPictureShape(image, 30, 30);

// assign XLPictureShape to cell
cell.Value = pic;</code></pre>



<a id="C1_C1Excel_XLPictureShape__ctor_" data-uid="C1.C1Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_C1Excel_XLPictureShape__ctor_System_Drawing_Image_System_Int32_System_Int32_System_Int32_System_Int32_" data-uid="C1.C1Excel.XLPictureShape.#ctor(System.Drawing.Image,System.Int32,System.Int32,System.Int32,System.Int32)">XLPictureShape(Image, int, int, int, int)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public XLPictureShape(Image img, int x, int y, int width, int height)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(img As Image, x As Integer, y As Integer, width As Integer, height As Integer)</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>The image contained in the new <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">x</span></td>
      <td><p>The horizontal position of the image with respect to the cell, in twips.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">y</span></td>
      <td><p>The vertical position of the image with respect to the cell, in twips.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>The width of the image, in twips.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>The height of the image, in twips.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_C1Excel_XLPictureShape__ctor_System_Drawing_Image_System_Int32_System_Int32_System_Int32_System_Int32__examples">Examples</h5>
<p>The code below adds an image to a cell. The image is drawn within a rectangle centered on a
cell with a 60 twip edge around it:</p>
<pre><code class="lang-csharp">// get sheet and cell
XLSheet sheet = c1ExcelBook1.Sheets[0];
XLCell  cell  = sheet[row, col];

// calculate cell size to align picture
Rectangle rc = new Rectangle(0, 0
    sheet.Columns[col].Width, 
    sheet.Rows[row].Height);

// add 60 twip edge
rc.Inflate(-60, -60);

// build XLPictureShape
XLPictureShape pic = new XLPictureShape(image, 
    rc.X, rc.Y, rc.Width, rc.Height);

// assign XLPictureShape to cell
cell.Value = pic;</code></pre>



<a id="C1_C1Excel_XLPictureShape__ctor_" data-uid="C1.C1Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_C1Excel_XLPictureShape__ctor_System_Drawing_Image_System_Drawing_Rectangle_" data-uid="C1.C1Excel.XLPictureShape.#ctor(System.Drawing.Image,System.Drawing.Rectangle)">XLPictureShape(Image, Rectangle)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public XLPictureShape(Image img, Rectangle rc)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(img As Image, rc As Rectangle)</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>The image contained in the new <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectangle">Rectangle</a></td>
      <td><span class="parametername">rc</span></td>
      <td><p>The rectangle that specifies the image size and position
with respect to the cell, in twips.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_C1Excel_XLPictureShape__ctor_System_Drawing_Image_System_Drawing_Rectangle__examples">Examples</h5>
<p>The code below adds an image to a cell. The image is drawn within a rectangle centered on a
cell with a 60 twip edge around it:</p>
<pre><code class="lang-csharp">// get sheet and cell
XLSheet sheet = c1ExcelBook1.Sheets[0];
XLCell  cell  = sheet[row, col];

// calculate cell size to align picture
Rectangle rc = new Rectangle(0, 0
    sheet.Columns[col].Width, 
    sheet.Rows[row].Height);

// add 60 twip edge
rc.Inflate(-60, -60);

// build XLPictureShape
XLPictureShape pic = new XLPictureShape(image, rc);

// assign XLPictureShape to cell
cell.Value = pic;</code></pre>



<a id="C1_C1Excel_XLPictureShape__ctor_" data-uid="C1.C1Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_C1Excel_XLPictureShape__ctor_System_Drawing_Image_" data-uid="C1.C1Excel.XLPictureShape.#ctor(System.Drawing.Image)">XLPictureShape(Image)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public XLPictureShape(Image img)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(img 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.drawing.image">Image</a></td>
      <td><span class="parametername">img</span></td>
      <td><p>The image contained in the new <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Excel_XLPictureShape__ctor_" data-uid="C1.C1Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_C1Excel_XLPictureShape__ctor_System_Drawing_Image_System_Drawing_Size_System_Drawing_ContentAlignment_C1_C1Excel_ImageScaling_" data-uid="C1.C1Excel.XLPictureShape.#ctor(System.Drawing.Image,System.Drawing.Size,System.Drawing.ContentAlignment,C1.C1Excel.ImageScaling)">XLPictureShape(Image, Size, ContentAlignment, ImageScaling)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public XLPictureShape(Image img, Size cellSize, ContentAlignment align, ImageScaling scale)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(img As Image, cellSize As Size, align As ContentAlignment, scale As ImageScaling)</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>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.image">Image</a> contained in the new <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.size">Size</a></td>
      <td><span class="parametername">cellSize</span></td>
      <td><p>The size of the cell that will contain the image, in pixels (used for aligning the image).</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 <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.contentalignment">ContentAlignment</a> value that specifies the position of the image in the cell.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.C1Excel.ImageScaling.html">ImageScaling</a></td>
      <td><span class="parametername">scale</span></td>
      <td><p>An <a class="xref" href="C1.C1Excel.ImageScaling.html">ImageScaling</a> value that specifies the image scaling within the cell.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_C1Excel_XLPictureShape__ctor_System_Drawing_Image_System_Drawing_Size_System_Drawing_ContentAlignment_C1_C1Excel_ImageScaling__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This constructor automatically calculates the image size, position, and clipping based on the cell and image sizes
and on the given alignment and scaling parameters.</p>
</div>
<h5 id="C1_C1Excel_XLPictureShape__ctor_System_Drawing_Image_System_Drawing_Size_System_Drawing_ContentAlignment_C1_C1Excel_ImageScaling__examples">Examples</h5>
<p>The code below adds an image to a cell. The image is centered within the cell and scaled to
fill the cell while preserving its aspect ratio.</p>
<pre><code class="lang-csharp">// get sheet and cell
XLSheet sheet = c1ExcelBook1.Sheets[0];
XLCell  cell  = sheet[row, col];

// calculate cell size to align picture
Size cellSize = new Size(
    sheet.Columns[col].Width, 
    sheet.Rows[row].Height);

// build XLPictureShape
XLPictureShape pic = new XLPictureShape(
    image,
    cellSize,
    ContentAlignment.MiddleCenter,
    ImageScaling.Scale);

// assign XLPictureShape to cell
cell.Value = pic;</code></pre>



<a id="C1_C1Excel_XLPictureShape__ctor_" data-uid="C1.C1Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_C1Excel_XLPictureShape__ctor_C1_C1Excel_XLSheet_System_Drawing_Image_System_Int32_System_Int32_System_Int32_System_Int32_" data-uid="C1.C1Excel.XLPictureShape.#ctor(C1.C1Excel.XLSheet,System.Drawing.Image,System.Int32,System.Int32,System.Int32,System.Int32)">XLPictureShape(XLSheet, Image, int, int, int, int)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public XLPictureShape(XLSheet sheet, Image img, int x, int y, int width, int height)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(sheet As XLSheet, img As Image, x As Integer, y As Integer, width As Integer, height As Integer)</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="C1.C1Excel.XLSheet.html">XLSheet</a></td>
      <td><span class="parametername">sheet</span></td>
      <td><p><a class="xref" href="C1.C1Excel.XLSheet.html">XLSheet</a> object that owns the new shape.</p>
</td>
    </tr>
    <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>The image contained in the new <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">x</span></td>
      <td><p>The horizontal position of the image with respect to the sheet, in twips.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">y</span></td>
      <td><p>The vertical position of the image with respect to the sheet, in twips.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>The width of the image, in twips.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>The height of the image, in twips.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Excel_XLPictureShape__ctor_" data-uid="C1.C1Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_C1Excel_XLPictureShape__ctor_C1_Win_Bitmap_C1Bitmap_System_Int32_System_Int32_" data-uid="C1.C1Excel.XLPictureShape.#ctor(C1.Win.Bitmap.C1Bitmap,System.Int32,System.Int32)">XLPictureShape(C1Bitmap, int, int)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public XLPictureShape(C1Bitmap bmp, int x, int y)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(bmp As C1Bitmap, x As Integer, y As Integer)</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><span class="xref">C1Bitmap</span></td>
      <td><span class="parametername">bmp</span></td>
      <td><p>The specified bitmap object contained in the new <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">x</span></td>
      <td><p>The horizontal position of the new shape with respect to the cell, in twips.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">y</span></td>
      <td><p>The vertical position of the new shape with respect to the cell, in twips.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Excel_XLPictureShape__ctor_" data-uid="C1.C1Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_C1Excel_XLPictureShape__ctor_C1_Win_Bitmap_C1Bitmap_System_Int32_System_Int32_System_Int32_System_Int32_" data-uid="C1.C1Excel.XLPictureShape.#ctor(C1.Win.Bitmap.C1Bitmap,System.Int32,System.Int32,System.Int32,System.Int32)">XLPictureShape(C1Bitmap, int, int, int, int)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public XLPictureShape(C1Bitmap bmp, int x, int y, int width, int height)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(bmp As C1Bitmap, x As Integer, y As Integer, width As Integer, height As Integer)</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><span class="xref">C1Bitmap</span></td>
      <td><span class="parametername">bmp</span></td>
      <td><p>The specified bitmap object contained in the new <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">x</span></td>
      <td><p>The horizontal position of the image with respect to the cell, in twips.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">y</span></td>
      <td><p>The vertical position of the image with respect to the cell, in twips.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>The width of the image, in twips.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>The height of the image, in twips.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Excel_XLPictureShape__ctor_" data-uid="C1.C1Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_C1Excel_XLPictureShape__ctor_C1_Win_Bitmap_C1Bitmap_System_Drawing_RectangleF_" data-uid="C1.C1Excel.XLPictureShape.#ctor(C1.Win.Bitmap.C1Bitmap,System.Drawing.RectangleF)">XLPictureShape(C1Bitmap, RectangleF)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public XLPictureShape(C1Bitmap bmp, RectangleF rc)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(bmp As C1Bitmap, 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><span class="xref">C1Bitmap</span></td>
      <td><span class="parametername">bmp</span></td>
      <td><p>The specified bitmap object contained in the new <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</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>The rectangle that specifies the image size and position
with respect to the cell, in twips.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Excel_XLPictureShape__ctor_" data-uid="C1.C1Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_C1Excel_XLPictureShape__ctor_C1_Win_Bitmap_C1Bitmap_" data-uid="C1.C1Excel.XLPictureShape.#ctor(C1.Win.Bitmap.C1Bitmap)">XLPictureShape(C1Bitmap)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public XLPictureShape(C1Bitmap bmp)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(bmp As C1Bitmap)</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><span class="xref">C1Bitmap</span></td>
      <td><span class="parametername">bmp</span></td>
      <td><p>The specified bitmap object contained in the new <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Excel_XLPictureShape__ctor_" data-uid="C1.C1Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_C1Excel_XLPictureShape__ctor_C1_Win_Bitmap_C1Bitmap_System_Drawing_Size_System_Drawing_ContentAlignment_C1_C1Excel_ImageScaling_" data-uid="C1.C1Excel.XLPictureShape.#ctor(C1.Win.Bitmap.C1Bitmap,System.Drawing.Size,System.Drawing.ContentAlignment,C1.C1Excel.ImageScaling)">XLPictureShape(C1Bitmap, Size, ContentAlignment, ImageScaling)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public XLPictureShape(C1Bitmap bmp, Size cellSize, ContentAlignment align, ImageScaling scale)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(bmp As C1Bitmap, cellSize As Size, align As ContentAlignment, scale As ImageScaling)</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><span class="xref">C1Bitmap</span></td>
      <td><span class="parametername">bmp</span></td>
      <td><p>The specified bitmap object contained in the new <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.size">Size</a></td>
      <td><span class="parametername">cellSize</span></td>
      <td><p>The size of the cell that will contain the image, in pixels (used for aligning the image).</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 <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.contentalignment">ContentAlignment</a> value that specifies the position of the image in the cell.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.C1Excel.ImageScaling.html">ImageScaling</a></td>
      <td><span class="parametername">scale</span></td>
      <td><p>An <a class="xref" href="C1.C1Excel.ImageScaling.html">ImageScaling</a> value that specifies the image scaling within the cell.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_C1Excel_XLPictureShape__ctor_C1_Win_Bitmap_C1Bitmap_System_Drawing_Size_System_Drawing_ContentAlignment_C1_C1Excel_ImageScaling__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This constructor automatically calculates the image size, position, and clipping based on the cell and image sizes
and on the given alignment and scaling parameters.</p>
</div>


<a id="C1_C1Excel_XLPictureShape__ctor_" data-uid="C1.C1Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_C1Excel_XLPictureShape__ctor_C1_C1Excel_XLSheet_C1_Win_Bitmap_C1Bitmap_System_Int32_System_Int32_System_Int32_System_Int32_" data-uid="C1.C1Excel.XLPictureShape.#ctor(C1.C1Excel.XLSheet,C1.Win.Bitmap.C1Bitmap,System.Int32,System.Int32,System.Int32,System.Int32)">XLPictureShape(XLSheet, C1Bitmap, int, int, int, int)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public XLPictureShape(XLSheet sheet, C1Bitmap bmp, int x, int y, int width, int height)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(sheet As XLSheet, bmp As C1Bitmap, x As Integer, y As Integer, width As Integer, height As Integer)</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="C1.C1Excel.XLSheet.html">XLSheet</a></td>
      <td><span class="parametername">sheet</span></td>
      <td><p><a class="xref" href="C1.C1Excel.XLSheet.html">XLSheet</a> object that owns the new shape.</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">C1Bitmap</span></td>
      <td><span class="parametername">bmp</span></td>
      <td><p>The specified bitmap object contained in the new <a class="xref" href="C1.C1Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">x</span></td>
      <td><p>The horizontal position of the image with respect to the sheet, in twips.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">y</span></td>
      <td><p>The vertical position of the image with respect to the sheet, in twips.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>The width of the image, in twips.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>The height of the image, in twips.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
