title: C# EPPlus resize pictures to fit in the cell
body: <p>I am trying to place a picture into B1 cell. picture is getting inserted but height is getting bigger than original image. <strong>how automatically height is getting stretched?</strong></p>
  <p>I am using EPPlus version <strong>4.0.6.0</strong> &amp; .Net version <strong>4.5.2</strong>. <strong>using VS IDE 2013</strong>.</p>
  <p>Here is the output screenshot.</p>
  <p><a href="https://i.stack.imgur.com/acavj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/acavj.png" alt="enter image description here" /></a></p>
  <p>Desired output screenshot</p>
  <p><a href="https://i.stack.imgur.com/In3jl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/In3jl.png" alt="enter image description here" /></a></p>
  <p>here is the code sample which i used to place <strong>picture into B1 cell</strong>.</p>
  <pre><code>imgCompanyLogo = Image.FromFile(@&quot;C:\Users\tridip\Desktop\Test1\www_files\image002.png&quot;);
  ws.Column(2).Width = Convert.ToDouble((45 + 0.11));
  ws.Row(1).Height = Convert.ToDouble((46.5 + 0.11));
  ExcelPicture pic = ws.Drawings.AddPicture(&quot;Logo&quot;, imgCompanyLogo);
  pic.SetPosition(0, 0, 1, 0);
  pic.SetSize(316, 60);
  </code></pre>
  <p>if i commented or not commented this line <code>pic.SetPosition(0, 0, 1, 0);</code> but always getting same output where picture is getting stretched.</p>
  <p>see the original image how it looks like. link here <a href="https://ibb.co/PCxw3v0" rel="nofollow noreferrer">https://ibb.co/PCxw3v0</a></p>
  <p>what is the mistake in my code? or suggest a fix by which i can get my desired output.</p>