diff options
author | Dominik Stadler <centic@apache.org> | 2016-05-22 16:08:51 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2016-05-22 16:08:51 +0000 |
commit | 00b6716c191f078b9b4608365d412d1be007c6cb (patch) | |
tree | ed51b5d446c76aef19432c3485795aea096273eb /src/examples | |
parent | 71cb9d1e53fbe7bf82d7c670c38a6debd892a41e (diff) | |
download | poi-00b6716c191f078b9b4608365d412d1be007c6cb.tar.gz poi-00b6716c191f078b9b4608365d412d1be007c6cb.zip |
Bug 58190: Add more overloaded methods for adding pictures from streams and files
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1745073 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/examples')
-rw-r--r-- | src/examples/src/org/apache/poi/xslf/usermodel/Tutorial5.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial5.java b/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial5.java index ae134de765..56ffcbc505 100644 --- a/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial5.java +++ b/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial5.java @@ -38,11 +38,11 @@ public class Tutorial5 { XMLSlideShow ppt = new XMLSlideShow();
XSLFSlide slide = ppt.createSlide();
- File img = new File(System.getProperty("POI.testdata.path"), "slideshow/clock.jpg");
- byte[] data = IOUtils.toByteArray(new FileInputStream(img));
- XSLFPictureData pictureIndex = ppt.addPicture(data, PictureType.PNG);
- /*XSLFPictureShape shape =*/ slide.createPicture(pictureIndex);
+ File img = new File(System.getProperty("POI.testdata.path", "test-data"), "slideshow/clock.jpg");
+ XSLFPictureData pictureData = ppt.addPicture(img, PictureType.PNG);
+
+ /*XSLFPictureShape shape =*/ slide.createPicture(pictureData);
FileOutputStream out = new FileOutputStream("images.pptx");
ppt.write(out);
|