title: Resize/compress picture using Apache POI hslf - PowerPoint
body: <p>Hi I build a powerpoint presentation using apache poi and add a lot of images to the presentation.</p>
  
  <pre><code>private void addImage(SlideShow slideShow, Sheet slide, File image, int x, int y, int w, int h) {
      try {
          int idx = slideShow.addPicture(image, Picture.JPEG);
          Picture pict = new Picture(idx);
          pict.setAnchor(new Rectangle(x, y, w, h));
          slide.addShape(pict);
      } catch (IOException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>The function works and I get a ppt presentation in the end, but the ppt file is too big and at another PC I get a heap space error.
  So I would like to resize / compress my images in the slides. I have four pictures on each slide - so they don't need to have the original resolution.</p>
  
  <p>Is there a build in function in poi to do this?
  Something like</p>
  
  <pre><code>pict.resize(width, height);
  </code></pre>
  
  <p>I'm using apache poi 3.7</p>
  
  <p>thx in advance</p>