title: Epplus SetPosition picture issue
body: <p>I am using <a href="http://epplus.codeplex.com/" rel="nofollow noreferrer">Epplus library</a> to generate Excel 2010 and up compatible files in Asp.Net C#.
  I am using version 3.1.2 which is the latest at this moment.</p>
  
  <p>I am setting the row height first, before adding any pictures like this:</p>
  
  <pre><code>ExcelPackage pck = new ExcelPackage();
  var ws = pck.Workbook.Worksheets.Add("sheet 1");
  while (i &lt; dt.Rows.Count + offset)
  {
      ws.Row(i).Height = 84;
      i++;
  }
  </code></pre>
  
  <p><code>dt</code> is my DataTable with DataRows.
  After setting the height, I am looping again through the rows to add the pictures</p>
  
  <pre><code>while (i &lt; dt.Rows.Count + offset)
  {
      var prodImg = ws.Drawings.AddPicture(dr["code"].ToString(), new FileInfo(path));
      prodImg.SetPosition(i - 1, 0, 14, 0);
      prodImg.SetSize(75);
  }
  </code></pre>
  
  <p>This works, but this does not:</p>
  
  <pre><code>var prodImg = ws.Drawings.AddPicture(dr["code"].ToString(), new FileInfo(path));
  int w = prodImg.Image.Width;
  int h = prodImg.Image.Height;
  
  if (h &gt; 140) // because height of 84 is 140 pixels in excel
  {
      double scale = h / 140.0;
      w = (int)Math.Floor(w / scale);
      h = 140;
  }
  
  int xOff = (150 - w) / 2;
  int yOff = (140 - h) / 2;
  
  prodImg.SetPosition(i - 1, xOff, 11, yOff);
  prodImg.SetSize(w, h);
  </code></pre>
  
  <p>This results in off center pictures and unresized images. And this code then which is in the same loop:</p>
  
  <pre><code>var prodImgDm = ws.Drawings.AddPicture("bcdm" + dr["code"].ToString(), new FileInfo(pathDm));
  prodImgDm.SetPosition(i - 1, 25, 15, 40);
  prodImgDm.SetSize(100);
  </code></pre>
  
  <p>This does work sometimes. the pictures <code>prodImgDm</code> are datamatrix images with a static width and height and do not need to be resized because they are always small/tiny. So also without the <code>SetSize</code> in some rows, it works and in some other rows, it does not work. Really strange because the code is the same. It might be something in the library and/or Excel. Perhaps I am using it wrong? Any epplus picture expert?</p>
  
  <p>Thanks in advance!!</p>
  
  <p><strong>edit</strong> sometimes a picture is worth a thousand words, so here is the screenshot. As you can see the product images are not horizontal and vertical aligned in the cell. And the datamatrix on the far right is sometimes scaled about 120% even when I set <code>SetSize(100)</code> so it is really strange to me. So the last datamatrix has the correct size... I already found <a href="https://stackoverflow.com/questions/11588704/adding-images-into-excel-using-epplus">this SO thread</a> but that does not help me out, I think.</p>
  
  <p><img src="https://i.stack.imgur.com/r6B6h.png" alt="epplus images"></p>
  
  <p><strong>edit</strong> 2013/04/09 Essenpillai gave me a hint to set </p>
  
  <pre><code>pck.DoAdjustDrawings = false;
  </code></pre>
  
  <p>but that gave me even stranger images:</p>
  
  <p><img src="https://i.stack.imgur.com/XXFxq.png" alt="doadjustdrawings"></p>
  
  <p>the datamatrix is still changing on row basis. on row is ok, the other is not. and the ean13 code is too wide.</p>