I am trying to read in a power point image to java for display on a userform.
I am not trying export the entire slide as an image. I need to access the just the image that have been inserted on to the slide.
I have tried the following code and I feel like I am really close but ImageIO.read is returning null.
public BufferedImage getImage2() {
java.io.InputStream fin = null;
try {
PackageRelationship packRel = mySlide.getPackagePart().getRelationship(myName);
PackagePart part = packRel.getSource();
fin = part.getInputStream();
BufferedImage imBuff = ImageIO.read(fin);
return imBuff;
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
} finally {
try {
fin.close();
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
}
return null;
}
If anyone has had any experience trying to do this it would be greatly appreciated. Thank you