title: Export multiple images from a directory to one Excel worksheet
body: <p>I would like to export images from an image folder to Excel with all images on one worksheet. I have managed to export an image but only one image. This is my code:</p>
  
  <pre><code>public void ExportToExcel()
      {
          //for export
          ExcelPackage objExcelPackage = new ExcelPackage();   //create new workbook
  
          string[] filesindirectory = Directory.GetFiles(Server.MapPath("~/Image"));
          int count = 0;
  
          ExcelWorksheet ws = objExcelPackage.Workbook.Worksheets.Add("Worksheet" + count); //create new worksheet
  
                      foreach (string img in filesindirectory)
                      {
                      count++;
                      System.Web.UI.WebControls.Image TEST_IMAGE = new System.Web.UI.WebControls.Image();
                      System.Drawing.Image myImage = System.Drawing.Image.FromFile(img);
                      var pic = ws.Drawings.AddPicture(count.ToString(), myImage);
                      // Row, RowoffsetPixel, Column, ColumnOffSetPixel
                      pic.SetPosition(1, 0, 2, 0);
                          }
                  }                            
          var filepath = new FileInfo(@"C:\Users\user\Desktop\Test\" + datetime.ToString("dd-MM-yyyy_hh-mm-ss") + ".xlsx");
          objExcelPackage.SaveAs(filepath);
      }
  </code></pre>
  
  <p>This is the output I want to achieve:  </p>
  
  <p><a href="https://i.stack.imgur.com/ZLH7t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZLH7t.png" alt="enter image description here"></a></p>
  
  <p>How to export all images from a directory to Excel in one Excel worksheet using EPPlus?</p>