title: How to add image to PowerPoint ppt table cell using apache POI hslf/xslf?
body: <p>i want to insert <strong>image</strong> in one of the <strong>tablecell</strong> of my <strong>ppt</strong> table using <strong>apache</strong> *<em>poi</em>*, other cells have text data. </p>
  
  <p>I didn't find any api to write image to tablecell. I tried using draw method of tablecell but got an exception.</p>
  
  <pre><code>      File file = new File("E:\PPTGeneratorJars\Search Definition.png");  
    BufferedImage image = ImageIO.read(file); 
    Graphics graphics= image.getGraphics();
    cell.draw((Graphics2D) graphics);
  </code></pre>
  
  <h3>Exception</h3>
  
  <pre><code>Exception in thread "main" java.lang.NullPointerException
      at org.apache.poi.hslf.usermodel.RichTextRun.getCharTextPropVal(RichTextRun.java:284)
      at org.apache.poi.hslf.usermodel.RichTextRun.getFontColor(RichTextRun.java:514)
      at org.apache.poi.hslf.model.TextPainter.getAttributedString(TextPainter.java:81)
      at org.apache.poi.hslf.model.TextPainter.getTextElements(TextPainter.java:161)
      at org.apache.poi.hslf.model.TextPainter.paint(TextPainter.java:98)
      at org.apache.poi.hslf.model.TextShape.draw(TextShape.java:562)
  </code></pre>
  
  <p>Can anyone please help me with this?</p>