# C1.WPF.Excel.XLPictureShape.-ctor

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_Excel_XLPictureShape__ctor_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor*">XLPictureShape Constructor
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_Excel_XLPictureShape__ctor_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_WPF_Excel_XLPictureShape__ctor_System_Windows_Media_Imaging_WriteableBitmap_System_Int32_System_Int32_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32)">XLPictureShape(WriteableBitmap, int, int)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.WPF.Excel.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(WriteableBitmap img, int x, int y)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(img As WriteableBitmap, 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.windows.media.imaging.writeablebitmap">WriteableBitmap</a></td>
      <td><span class="parametername">img</span></td>
      <td><p>The image contained in the new <a class="xref" href="C1.WPF.Excel.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_WPF_Excel_XLPictureShape__ctor_System_Windows_Media_Imaging_WriteableBitmap_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_WPF_Excel_XLPictureShape__ctor_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_WPF_Excel_XLPictureShape__ctor_System_Windows_Media_Imaging_WriteableBitmap_System_Int32_System_Int32_System_Int32_System_Int32_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor(System.Windows.Media.Imaging.WriteableBitmap,System.Int32,System.Int32,System.Int32,System.Int32)">XLPictureShape(WriteableBitmap, int, int, int, int)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.WPF.Excel.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(WriteableBitmap 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 WriteableBitmap, 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.windows.media.imaging.writeablebitmap">WriteableBitmap</a></td>
      <td><span class="parametername">img</span></td>
      <td><p>The image contained in the new <a class="xref" href="C1.WPF.Excel.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_WPF_Excel_XLPictureShape__ctor_System_Windows_Media_Imaging_WriteableBitmap_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_WPF_Excel_XLPictureShape__ctor_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_WPF_Excel_XLPictureShape__ctor_System_Windows_Media_Imaging_WriteableBitmap_System_Windows_Rect_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor(System.Windows.Media.Imaging.WriteableBitmap,System.Windows.Rect)">XLPictureShape(WriteableBitmap, Rect)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.WPF.Excel.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(WriteableBitmap img, Rect rc)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(img As WriteableBitmap, rc As Rect)</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.windows.media.imaging.writeablebitmap">WriteableBitmap</a></td>
      <td><span class="parametername">img</span></td>
      <td><p>The image contained in the new <a class="xref" href="C1.WPF.Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.rect">Rect</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_WPF_Excel_XLPictureShape__ctor_System_Windows_Media_Imaging_WriteableBitmap_System_Windows_Rect__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_WPF_Excel_XLPictureShape__ctor_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_WPF_Excel_XLPictureShape__ctor_System_Windows_Media_Imaging_WriteableBitmap_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor(System.Windows.Media.Imaging.WriteableBitmap)">XLPictureShape(WriteableBitmap)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.WPF.Excel.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(WriteableBitmap img)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(img As WriteableBitmap)</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.windows.media.imaging.writeablebitmap">WriteableBitmap</a></td>
      <td><span class="parametername">img</span></td>
      <td><p>The image contained in the new <a class="xref" href="C1.WPF.Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_Excel_XLPictureShape__ctor_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_WPF_Excel_XLPictureShape__ctor_System_Windows_Media_Imaging_WriteableBitmap_System_Windows_Size_System_Windows_HorizontalAlignment_System_Windows_VerticalAlignment_C1_WPF_Excel_ImageScaling_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor(System.Windows.Media.Imaging.WriteableBitmap,System.Windows.Size,System.Windows.HorizontalAlignment,System.Windows.VerticalAlignment,C1.WPF.Excel.ImageScaling)">XLPictureShape(WriteableBitmap, Size, HorizontalAlignment, VerticalAlignment, ImageScaling)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.WPF.Excel.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(WriteableBitmap img, Size cellSize, HorizontalAlignment align, VerticalAlignment valign, ImageScaling scale)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(img As WriteableBitmap, cellSize As Size, align As HorizontalAlignment, valign As VerticalAlignment, 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.windows.media.imaging.writeablebitmap">WriteableBitmap</a></td>
      <td><span class="parametername">img</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.media.imaging.writeablebitmap">WriteableBitmap</a> contained in the new <a class="xref" href="C1.WPF.Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.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.windows.horizontalalignment">HorizontalAlignment</a></td>
      <td><span class="parametername">align</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.horizontalalignment">HorizontalAlignment</a> value that specifies the position of the image in the cell.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.verticalalignment">VerticalAlignment</a></td>
      <td><span class="parametername">valign</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.verticalalignment">VerticalAlignment</a> value that specifies the position of the image in the cell.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Excel.ImageScaling.html">ImageScaling</a></td>
      <td><span class="parametername">scale</span></td>
      <td><p>An <a class="xref" href="C1.WPF.Excel.ImageScaling.html">ImageScaling</a> value that specifies the image scaling within the cell.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_WPF_Excel_XLPictureShape__ctor_System_Windows_Media_Imaging_WriteableBitmap_System_Windows_Size_System_Windows_HorizontalAlignment_System_Windows_VerticalAlignment_C1_WPF_Excel_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_WPF_Excel_XLPictureShape__ctor_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_WPF_Excel_XLPictureShape__ctor_C1_WPF_Excel_XLSheet_System_Windows_Media_Imaging_WriteableBitmap_System_Double_System_Double_System_Double_System_Double_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor(C1.WPF.Excel.XLSheet,System.Windows.Media.Imaging.WriteableBitmap,System.Double,System.Double,System.Double,System.Double)">XLPictureShape(XLSheet, WriteableBitmap, double, double, double, double)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.WPF.Excel.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, WriteableBitmap img, double x, double y, double width, double height)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(sheet As XLSheet, img As WriteableBitmap, x As Double, y As Double, width As Double, height As Double)</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.WPF.Excel.XLSheet.html">XLSheet</a></td>
      <td><span class="parametername">sheet</span></td>
      <td><p><a class="xref" href="C1.WPF.Excel.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.windows.media.imaging.writeablebitmap">WriteableBitmap</a></td>
      <td><span class="parametername">img</span></td>
      <td><p>The image contained in the new <a class="xref" href="C1.WPF.Excel.XLPictureShape.html">XLPictureShape</a>.</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 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.double">double</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.double">double</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.double">double</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_WPF_Excel_XLPictureShape__ctor_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_WPF_Excel_XLPictureShape__ctor_C1_WPF_Bitmap_C1Bitmap_System_Int32_System_Int32_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor(C1.WPF.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.WPF.Excel.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.WPF.Excel.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_WPF_Excel_XLPictureShape__ctor_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_WPF_Excel_XLPictureShape__ctor_C1_WPF_Bitmap_C1Bitmap_System_Int32_System_Int32_System_Int32_System_Int32_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor(C1.WPF.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.WPF.Excel.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.WPF.Excel.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_WPF_Excel_XLPictureShape__ctor_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_WPF_Excel_XLPictureShape__ctor_C1_WPF_Bitmap_C1Bitmap_System_Windows_Rect_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor(C1.WPF.Bitmap.C1Bitmap,System.Windows.Rect)">XLPictureShape(C1Bitmap, Rect)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.WPF.Excel.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, Rect rc)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(bmp As C1Bitmap, rc As Rect)</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.WPF.Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.rect">Rect</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_WPF_Excel_XLPictureShape__ctor_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_WPF_Excel_XLPictureShape__ctor_C1_WPF_Bitmap_C1Bitmap_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor(C1.WPF.Bitmap.C1Bitmap)">XLPictureShape(C1Bitmap)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.WPF.Excel.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.WPF.Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_Excel_XLPictureShape__ctor_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_WPF_Excel_XLPictureShape__ctor_C1_WPF_Bitmap_C1Bitmap_System_Windows_Size_System_Windows_HorizontalAlignment_System_Windows_VerticalAlignment_C1_WPF_Excel_ImageScaling_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor(C1.WPF.Bitmap.C1Bitmap,System.Windows.Size,System.Windows.HorizontalAlignment,System.Windows.VerticalAlignment,C1.WPF.Excel.ImageScaling)">XLPictureShape(C1Bitmap, Size, HorizontalAlignment, VerticalAlignment, ImageScaling)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.WPF.Excel.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, HorizontalAlignment align, VerticalAlignment valign, 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 HorizontalAlignment, valign As VerticalAlignment, 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.WPF.Excel.XLPictureShape.html">XLPictureShape</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.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.windows.horizontalalignment">HorizontalAlignment</a></td>
      <td><span class="parametername">align</span></td>
      <td><p>A horizontal content alignment value that specifies the position of the image in the cell.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.verticalalignment">VerticalAlignment</a></td>
      <td><span class="parametername">valign</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.verticalalignment">VerticalAlignment</a> value that specifies the position of the image in the cell.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Excel.ImageScaling.html">ImageScaling</a></td>
      <td><span class="parametername">scale</span></td>
      <td><p>An <a class="xref" href="C1.WPF.Excel.ImageScaling.html">ImageScaling</a> value that specifies the image scaling within the cell.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_WPF_Excel_XLPictureShape__ctor_C1_WPF_Bitmap_C1Bitmap_System_Windows_Size_System_Windows_HorizontalAlignment_System_Windows_VerticalAlignment_C1_WPF_Excel_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_WPF_Excel_XLPictureShape__ctor_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor*"></a>
<h4 id="C1_WPF_Excel_XLPictureShape__ctor_C1_WPF_Excel_XLSheet_C1_WPF_Bitmap_C1Bitmap_System_Double_System_Double_System_Double_System_Double_" data-uid="C1.WPF.Excel.XLPictureShape.#ctor(C1.WPF.Excel.XLSheet,C1.WPF.Bitmap.C1Bitmap,System.Double,System.Double,System.Double,System.Double)">XLPictureShape(XLSheet, C1Bitmap, double, double, double, double)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of an <a class="xref" href="C1.WPF.Excel.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, double x, double y, double width, double height)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(sheet As XLSheet, bmp As C1Bitmap, x As Double, y As Double, width As Double, height As Double)</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.WPF.Excel.XLSheet.html">XLSheet</a></td>
      <td><span class="parametername">sheet</span></td>
      <td><p><a class="xref" href="C1.WPF.Excel.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.WPF.Excel.XLPictureShape.html">XLPictureShape</a>.</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 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.double">double</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.double">double</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.double">double</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>The height of the image, in twips.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
