title: how I can place an image just in one cell using npoi
body: <p>I'm using <a href="http://npoi.codeplex.com/documentation" rel="nofollow">npoi</a> to generate excel docs. I have a requirement to add images to cells. Using the following code i can insert images into my doc. However the image span many cells. How can i ensure that the image just fits inside once cell. </p>
  
  <pre><code>public ActionResult NPOICreate()
  {
      try
      {
          FileStream fs = new FileStream(Server.MapPath(@"\Content\NPOITemplate.xls"), FileMode.Open, FileAccess.ReadWrite);
          HSSFWorkbook templateWorkbook = new HSSFWorkbook(fs, true);
          var sheet = templateWorkbook.GetSheet("Sheet1");
          var patriarch = sheet.CreateDrawingPatriarch();
          HSSFClientAnchor anchor;
          anchor = new HSSFClientAnchor(0, 0, 0, 0, (short)4, 2, (short)6, 5);
          anchor.AnchorType = 2;
          var picture = patriarch.CreatePicture(anchor, LoadImage(@"D:\dev\Website/HumpbackWhale.jpg", templateWorkbook));
          picture.Resize();
          picture.LineStyle = HSSFPicture.LINESTYLE_DASHDOTGEL;
          sheet.ForceFormulaRecalculation = true;
          MemoryStream ms = new MemoryStream();
          templateWorkbook.Write(ms);
          TempData["Message"] = "Excel report created successfully!";
          return File(ms.ToArray(), "application/vnd.ms-excel", "NPOINewFile.xls");
      }
      catch (Exception ex)
      {
          TempData["Message"] = "Oops! Something went wrong.";
  
          return RedirectToAction("NPOI");
      }
  
  }
  </code></pre>